s-news
[Top] [All Lists]

writing output

To: "'s-news@lists.biostat.wustl.edu'" <s-news@lists.biostat.wustl.edu>
Subject: writing output
From: "Fox, G.J.A. (EDTE)" <G.J.A.Fox@edte.utwente.nl>
Date: Thu, 23 May 2002 09:47:01 +0200
Hello,

I have a function that writes the output to a report file. I am using cat
and the format functions to control the writing of the output. It want to
write the output in rows, in a fixed format, but it doesn't work, for
example:  

 p=c(1.2345,1.2345,1.2345,1.2345) 
 q=c(1.2345,-1.2345,-1.2345,1.2345)

 cat(format(p,nsmall=4,digits=6),"\n") 
 cat(format(q,nsmall=4,digits=6),"\n")

results in:

1.2345 1.2345 1.2345 1.2345 
 1.2345 -1.2345 -1.2345  1.2345 

But I want something like this,    
1.2345  1.2345  1.2345  1.2345 
1.2345 -1.2345 -1.2345  1.2345 

Greetings, Jean-Paul.

_________________________________________________
 
dr.ir. G.J.A. Fox
Twente University
Faculty of Educational Science and Technology
 
PO. Box 217, 7500 AE Enschede
The Netherlands
 
E-Mail FoxJ@edte.utwente.nl <mailto:FoxJ@edte.utwente.nl> 
HomePage http://users.edte.utwente.nl/Fox
Voice +31 (0)53 4893326
_________________________________________________

 

<Prev in Thread] Current Thread [Next in Thread>
  • writing output, Fox, G.J.A. (EDTE) <=