I have two questions regarding the use of function dput(). I am using R (v1.0.1) to create input files for WinBUGS. First, I would like to have the output data round to the specified decimal places. I used function round(). However, occasionally, dput() will write 0.0005 as 5e-4. Is there a way to correct this? Second, when writing a matrix, the resulting output is in the form: structure(c(0, 1, ...), .Dim=c(2,3)) Is it possible to have the same output format as in Splus: structure(.Data=c(0, 1, ...), .Dim=c(2,3)) Thanks in advance. ===== Song Qian Assistant Professor Environmental Sciences and Resources Portland State University Portland, OR 97207-0751 http://web.pdx.edu/~qians __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/ -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
dput
2 messages · Song Qian, Brian Ripley
On Thu, 4 May 2000, Song Qian wrote:
I have two questions regarding the use of function dput(). I am using R (v1.0.1) to create input files for WinBUGS. First, I would like to have the output data round to the specified decimal places. I used function round(). However, occasionally, dput() will write 0.0005 as 5e-4. Is there a way to correct this?
What need `correct'ion? They are the same thing!
Second, when writing a matrix, the resulting output is in the form: structure(c(0, 1, ...), .Dim=c(2,3)) Is it possible to have the same output format as in Splus: structure(.Data=c(0, 1, ...), .Dim=c(2,3))
Not easily.
Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._