I have this data.frame for example:
ds = data.frame(A= c("a","b","c","d") ,B= as.factor( c("4*10^4","2*10^3", "5000", "8*10^7")) )
I want to convert the column B to numeric and compute values inside it.
This code work for 1 cell:
eval(parse(text = "4*10^4"))
But when I try to loop over all my column with this line:
ds$B = for (i in ds$B) {eval(parse(text=i))}
It delete my column