Yan Yu
2003-Jul-30 23:08 UTC
[R] a quick Q: a function in R, equivalent to "atoi" function in C?
Hello, 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? 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
Jerome Asselin
2003-Jul-30 23:18 UTC
[R] a quick Q: a function in R, equivalent to "atoi" function in C?
?as.numeric On July 30, 2003 04:08 pm, Yan Yu wrote:> Hello, > 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? > > 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 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Thomas W Blackwell
2003-Jul-30 23:20 UTC
[R] a quick Q: a function in R, equivalent to "atoi" function in C?
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