[R] a quick Q: a function in R, equivalent to "atoi" function in C?

Thomas W Blackwell tblackw at umich.edu
Thu Jul 31 01:20:33 CEST 2003


On Wed, 30 Jul 2003, Yan Yu wrote:

>    I wonder is there a function in R, which can achieve the functionality
> of atoi in C, i.e., convert from a character string to a number?

as.numeric()

> I use Sys.getenv(), it returns a character string, e.g., "12", but i need
> a number, e.g., 12, to fit into a function.  thanks a lot,
> yan




More information about the R-help mailing list