Skip to content
Prev 274835 / 398506 Next

converting string fractions to numerics

Dear R People:

Suppose I have the following:

"pi/2"

and I would like it to be 1.57.....

Using as.numeric, here is my result:
[1] NA
Warning message:
NAs introduced by coercion
Is there a way to produce the numeric result, please?

Thanks,
Erin