I am trying to dynamically change the type of a variable in a loop. Right now I have the following line of code
assign(paste("contractrenewal",i,
"[,\"SContract Product ID from Object\"]",sep = ""),
as.character(paste("contractrenewal",i,
"[,\"SContract Product ID from Object\"]", sep = "")))
Here, i runs from 1 to 18 and I have 18 dataframes that are as follows (contractrenewal1
, contractrenewal2
, ... , contractrenewal18
). I have a column in each of these dataframes names SContract Product ID from Object
that is of type int and I want it to be of character type.
The above code executes fine, but does not achieve what I am looking for. I have looked around and haven't been able to find anything like this