I have a variable in scientific notation that is been passed to my script as a string. as.numeric returns and NA when I try to convert it to numeric. However, if I provide the exact same number (without the quotes, of course) I can operate the variable normally. Is there a way to parse scientific notation that is provided as a character?
> varc = "4.38962*10^-8"
> as.numeric(varc)
[1] NA
Warning message:
NAs introduced by coercion
> varn = 4.38962*10^-8
> varn*10
[1] 4.38962e-07