R: Converting from string to double -
I am trying to convert from string to r in two. However, every time I change numbers, R creates integers.
For example:
a = "100.11" a = as.double (a)
and output 100
. How do I maintain a decimal when changing from string to numeric? I have set the option (number = 3)
.
thanks
Mike
The problem is that Option that is selected:
option (number = 3) as.double ("100.11") # [1] 100 points (number = 5) as.double ("100.11") # [ 1] 100.11
digit
"Number prints the number of digits to print when printing numbers" values. You set options to 3 and 3 points are shown.
Comments
Post a Comment