[R] Help with decimal points

Amit Patel amitrhelp at yahoo.co.uk
Tue Sep 7 22:38:52 CEST 2010


Hi


I have found a little problem with an R script. I am trying to merge some data 
and am finding something unusual going on. As shown below I am trying to 
assign (MatchedValues[Value2,Value]) to  (ClusteredData[k,Value]) which are two 
separate dataframes.

1) By the following command you can see that the value im transferring 
is 481844.03

> MatchedValues[Value2,Value]
[1] 481844.03
6618 Levels: 1.00E+07 1.01E+07 1.02E+07 1.04E+07 1.05E+07 1.06E+07 ... Raw


2) But when I try to replace the values using the command i get a value of 4420


>ClusteredData[k,Value] <- MatchedValues[Value2,Value]

> ClusteredData[k,Value]
[1] "4420"


3) So what am I not doing. How can I keep that same value of 481844.03
I have tried


> as.double(MatchedValues[Value2,Value])
[1] 4420


> as.numeric(MatchedValues[Value2,Value])
[1] 4420






More information about the R-help mailing list