[18823] in s-news-athena

home help back first fref pref prev next nref lref last post

[S] re: digits runs amok

daemon@ATHENA.MIT.EDU (fan@katan.cybercom.net)
Mon Aug 2 18:38:16 1999

From: fan@katan.cybercom.net
Date: Mon, 2 Aug 1999 18:34:18 -0400 (EDT)
To: s-news@wubios.wustl.edu
Message-Id: <Pine.LNX.4.04.9908021831440.4781-100000@katan.cybercom.net>
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII


The command 
  write(round(x,3), "x", sep=" ")
works. Thanks.


From: fan@katan.cybercom.net
Received: (from fan@localhost)
        by katan.cybercom.net (8.8.7/8.8.7) id RAA03169
        for s-news@wubios.wustl.edu; Mon, 2 Aug 1999 17:27:54 -0400
Date: Mon, 2 Aug 1999 17:27:54 -0400
Message-Id: <199908022127.RAA03169@katan.cybercom.net>
To: s-news@wubios.wustl.edu
Sender: owner-s-news@wubios.wustl.edu
X-loop: s-news
Precedence: bulk
Status: R


In writing data out to a file, how to define the number of digits of data?
I would throw out the digits at the end when writing it to a text file.
Therefore, I look for usage on page format using write(), write.table().
In particular, options(digits=..) has no effect.

Example:
x <- matrix(1:100, 10, 10)
x <- log(1+x)
  # x is a matrix of fractions with long digits.
write(x, "x")
  # "x" is messy to read; not many digits of precision are necessary.
options(digits=3)
write(x, "x")
  #no effect.



-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

home help back first fref pref prev next nref lref last post