[R] function: as.integer
R. Michael Weylandt <michael.weylandt@gmail.com>
michael.weylandt at gmail.com
Tue Jan 31 12:34:11 CET 2012
They are rounded to integers because you used as.integer(). Perhaps you meant to use as.double()
Michael
On Jan 31, 2012, at 6:21 AM, Marion Wenty <marion.wenty at gmail.com> wrote:
> dear r-helpers,
>
> i created an object named A, which looks like this:
>
> A <- c("4.4","1.9","4.1")
>
> now i needed to get numbers instead of characters and for this i used the
> function:
>
> as.integer(A)
>
>
> which resulted in:
>
>
> [1] 4 1 4
>
>
> My question is, why the numbers are rounded or more impotantly if
> there is a way to keep the decimal numbers?
>
>
> Thank you very much for your help in advance!
>
>
> Marion
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list