Hello.

I need that Sweave writes R output to a file. To do it, I put the following 
into the foo.Rnw file:


\documentclass{article}
\usepackage{Sweave}
\begin{document}

...

<<echo=F>>=
x <- rnorm(100)
y <- rnorm(100)
sink("foo.txt")
summary(lm(y~x))
sink()
@

...

\end{document}


When I run:

R CMD Sweave foo.Rnw

R responses:

Warning message:
In sink() : no sink to remove, 

and It doesn't work. Somebody knows how I can fix it?

Thanks,

Arnau.



------------------------------------------------------------
Arnau Mir Torres
Edifici A. Turmeda
Campus UIB
Ctra. Valldemossa, km. 7,5
07122 Palma de Mca.
tel: (+34) 971172987
fax: (+34) 971173003
email: arnau....@uib.es
URL: http://dmi.uib.es/~arnau

______________________________________________
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.

Reply via email to