Re: [R] Add notes to sink output

2008-10-13 Thread Rolf Turner


On 14/10/2008, at 9:02 AM, Michael Just wrote:


Hello,
How can I add notes (i.e. text) to a sink output?

sink(test.txt)
#This text will describe the test
summary(x)
sink()

How can I add that text above to the sink output?


?cat

##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
R-help@r-project.org 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.


Re: [R] Add notes to sink output

2008-10-13 Thread Ted Harding
On 13-Oct-08 20:02:20, Michael Just wrote:
 Hello,
 How can I add notes (i.e. text) to a sink output?
 
 sink(test.txt)
#This text will describe the test
 summary(x)
 sink()
 
 How can I add that text above to the sink output?
 Thanks,
 Michael

Anything on the lines of:

  sink(test.txt)
  cat(This text will describe the test\n)
  cat(\n)
  summary(x)
  sink()




E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 13-Oct-08   Time: 21:12:54
-- XFMail --

__
R-help@r-project.org 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.


Re: [R] Add notes to sink output

2008-10-13 Thread Jorge Ivan Velez
Dear Michael,
You can use cat() as follows:

sink(test.txt)
cat('Here goes your text','\n','\n')  # \n writes white spaces
summary(x)
sink()

See ?cat for more information.

HTH,

Jorge


On Mon, Oct 13, 2008 at 4:02 PM, Michael Just [EMAIL PROTECTED] wrote:

 Hello,
 How can I add notes (i.e. text) to a sink output?

 sink(test.txt)
 #This text will describe the test
 summary(x)
 sink()

 How can I add that text above to the sink output?

 Thanks,
 Michael

[[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.


[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Add notes to sink output

2008-10-13 Thread Michael Just
Thanks for the swift response.

cat it is.

Cheers,
Michael

On Mon, Oct 13, 2008 at 3:14 PM, Jorge Ivan Velez
[EMAIL PROTECTED]wrote:


 Dear Michael,
 You can use cat() as follows:

 sink(test.txt)
 cat('Here goes your text','\n','\n')  # \n writes white spaces
 summary(x)
 sink()

 See ?cat for more information.

 HTH,

 Jorge


 On Mon, Oct 13, 2008 at 4:02 PM, Michael Just [EMAIL PROTECTED] wrote:

 Hello,
 How can I add notes (i.e. text) to a sink output?

 sink(test.txt)
 #This text will describe the test
 summary(x)
 sink()

 How can I add that text above to the sink output?

 Thanks,
 Michael

[[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.




[[alternative HTML version deleted]]

__
R-help@r-project.org 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.


Re: [R] Add notes to sink output

2008-10-13 Thread Greg Snow
An alternative is to use txtStart (and other functions mentioned in the same 
help page) from the TeachingDemos package. This does the sinking, but can also 
include the commands as well as allow you to insert comments.  The etxt 
variants allow you to postprocess the whole transcript into a postscript (then 
pdf) file including selected graphics.

--
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
801.408.8111


 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
 project.org] On Behalf Of Michael Just
 Sent: Monday, October 13, 2008 2:02 PM
 To: r-help
 Subject: [R] Add notes to sink output

 Hello,
 How can I add notes (i.e. text) to a sink output?

 sink(test.txt)
 #This text will describe the test
 summary(x)
 sink()

 How can I add that text above to the sink output?

 Thanks,
 Michael

 [[alternative HTML version deleted]]

 __
 R-help@r-project.org 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.

__
R-help@r-project.org 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.