hi, is it possible to convert latex code to pdf in R (like a latex-program would do it)? Is there a package that comes with this capabilities? My problem is that I want to generate tables automatically - and I can't use a latex editor at that computer ... Besides latex ... are there good ways to generate tables in R? thanks for any suggestions!
> > is it possible to convert latex code to pdf in R (like a > latex-program would do it)? > Is there a package that comes with this capabilities? > > > My problem is that I want to generate tables automatically - > and I can't use a latex editor at that computer ... > > > Besides latex ... are there good ways to generate tables in R?Have a look at Sweave and xtable - I think that's what you want. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f?r Genomorientierte Bioinformatik Technische Universit?t M?nchen Wissenschaftszentrum Weihenstephan 85350 Freising, Germany http://webclu.bio.wzw.tum.de/~pagel/
Martin Batholdy wrote:> > is it possible to convert latex code to pdf in R (like a latex-program > would do it)? > Is there a package that comes with this capabilities? >Unfortunately you're out of luck if you're seeking a direct path from LaTeX code generated in R to pdf without passing through a LaTeX compiler. Re-implementing the pdfTeX compiler in R would be a monumental undertaking as the TeX macro-expansion language is pretty hairy-- low-level TeX can make the worst Perl screen-vomit look tame by comparison. And that's just TeX-- throw in a pile of LaTeX macro packages and the difficulty shoots up another order of magnitude or two. Martin Batholdy wrote:> > My problem is that I want to generate tables automatically - > and I can't use a latex editor at that computer ... > > Besides latex ... are there good ways to generate tables in R? >There's the xtable package which can perform some automagical formatting of R objects to LaTeX code. If you don't have access to LaTeX at a workstation, you could try using xtable's HTML output mode-- then use Word or OpenOffice to open the HTML file and copy the table. There are also a few utilities out there that can perform a conversion from TeX to HTML-- they might be worth Googling if xtable's HTML output isn't working for you. Good luck! -Charlie ----- Charlie Sharpsteen Undergraduate Environmental Resources Engineering Humboldt State University -- View this message in context: http://www.nabble.com/latex-code-in-R--%3E-convert-to-pdf-tp25486430p25487067.html Sent from the R help mailing list archive at Nabble.com.
Hi,
for basic tables (e.g. display a data.frame without fancy formatting),
you could try the textplot() function from the gplots package, or this
rough function for Grid graphics,
source("http://gridextra.googlecode.com/svn/trunk/R/tableGrob.r")
# install.packages("gridextra",
repos="http://R-Forge.R-project.org")
?tc ?= textConnection("
? ? ? carat ? VeryLongWordIndeed color clarity depth
?14513 ?1.35 Ideal ? ? J ? ? VS2 ?61.4
?28685 ?0.30 ?Good ? ? G ? ?VVS1 ?64.0
?50368 ?0.75 Ideal ? ? F ? ? SI2 ?59.2")
?d = read.table(tc,head=T)
?close(tc)
?grid.newpage()
?grid.table(d)
HTH,
baptiste
2009/9/17 Martin Batholdy <batholdy at
googlemail.com>>
> hi,
>
>
> is it possible to convert latex code to pdf in R (like a latex-program
would do it)?
> Is there a package that comes with this capabilities?
>
>
> My problem is that I want to generate tables automatically -
> and I can't use a latex editor at that computer ...
>
>
>
> Besides latex ... are there good ways to generate tables in R?
>
>
>
>
> thanks for any suggestions!
>
> ______________________________________________
> R-help at 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.