Hi

I used write() the other day to save some results.

It seems that write() does not record the full precision of
the objects being written:


 > write(pi,file="~/f",ncolumns=1)
 > pi.saved <- scan("~/f")
Read 1 item
 > dput(pi)
3.14159265358979
 > dput(pi.saved)
3.141593
 > pi-pi.saved
[1] -3.464102e-07
 >


This difficulty was particularly difficult to find because pi.saved   
*looks*
the same as pi.



What's going on here?






 > R.Version()
$platform
[1] "powerpc-apple-darwin8.7.0"

$arch
[1] "powerpc"

$os
[1] "darwin8.7.0"

$system
[1] "powerpc, darwin8.7.0"

$status
[1] ""

$major
[1] "2"

$minor
[1] "4.0"

$year
[1] "2006"

$month
[1] "10"

$day
[1] "03"

$`svn rev`
[1] "39566"

$language
[1] "R"

$version.string
[1] "R version 2.4.0 (2006-10-03)"


--
Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

______________________________________________
[email protected] 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.

Reply via email to