[R] stop R from rounding

Alyse aalarkin at gmail.com
Thu Oct 20 05:29:49 CEST 2011


Hello, 

I have a column in a data frame that need to be 10 digits long.  As such: 

     Decimal.Year        
 1  1994.25997
 2  1994.26020

However, R keeps rounding the digits.  As such: 

    Decimal.Year
1  1994.260
2  1994.260 

*Is there any way to stop this from happening?*  

Here is how I created the data frame: 

x <- read.table('bats_1994_CTD.txt')
colnames(x) <-
c('Cruise','Dec.Year','Lat.N','Long.W','Press','Depth','Temp','Sal','Oxy')
date <- subset(x,select=c(Dec.Year), (Depth<201) & (Depth>199))
datelist <- list(date$Dec.Year)
temp <- subset(x,select=c(Temp), (Depth<201) & (Depth>199))
tempmean <- aggregate(temp,by=datelist,FUN=mean)
tempframe <- data.frame(tempmean) #the first column of this dataframe is the
one that I don't want R to round

Thank you!

--
View this message in context: http://r.789695.n4.nabble.com/stop-R-from-rounding-tp3920803p3920803.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list