[R] typecasting a function from character to double

LucasM l.s.molleman at rug.nl
Mon Feb 28 08:18:32 CET 2011


Hello,
I try to plot a number of functions that are given by a textfile. This file
looks like this:
----
(1+s) / (1+k) ;
(1+(2*s)^2) / (1+k)^2 ;
etc etc.
----

I import these functions into R with the 'readLines' command. This creates a
table whose elements contain the conditions as character strings. I want to
generically plot the functions (there are many) while varying k, but the
type of the imported functions is 'character'. I cannot coerce it to double;
this creates NaN's. 

Any suggestions for a way out?

-- 
View this message in context: http://r.789695.n4.nabble.com/typecasting-a-function-from-character-to-double-tp3327555p3327555.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list