Re: [R] Sweave function

2010-07-06 Thread Eik Vettorazzi
Hi, I don't know why, but your resulting table is not latex but html. (e.g. & is not recognized in latex). NA.string is an argument for print.xtable, not for xtable itself and is case sensitive. So <>= report2=lapply(report1, function(x) { print(xtable(x),NA.string="-")}) @ should work. hth.

[R] Sweave function

2010-07-06 Thread n.via...@libero.it
Dear list, I'm trying to generate a latex Document in which there are a lot of tables. I'm using the Sweave function in the package utils, but I'm having a lot of problems with the format. This is my code: \documentclass[a4paper]{amsbook} \title{Schema di bilancio} \begin{document} \maketitle <>

Re: [R] Sweave function

2010-07-01 Thread Allan Engelhardt
In general, use cat (see help("cat")) for printing your output, e.g. <>= cat(levels(mydata$Firms)[mydata$Firms], "\n") cat(mydata$Year, "\n") # etc. @ For your specific case you may also be interested in help("xtable", package="xtable") along with the <<...,results=tex>>= Sweave construct. F

[R] Sweave function

2010-07-01 Thread n.via...@libero.it
Dear list, I have a question about the interaction between R code and Latex language trough the Sweave function in the package "utils". What I'm trying to do is to write a report. Contrary to the examples shown in the Sweave Manual in which table already constructed by R are "exported" on Lat