2

I have a quick question on the conversion from R to Latex. I did a lot of calculations in R to produce various tables. These are not standard, but rather custom objects. Next I'd like to convert the results to my Latex document which is generally created by Texstudio.

Some of the R-packages I have checked here: Tools for making latex tables in R allow for standard objects to be converted into Latex tables.

I think the question is interesting to a lot of people: What is the usual package you would use for this purpose? There are a few packages out there which could be used, but I am asking for experience and recommendations in the described context. Some of my tables are quite big, others rather small. Also someone recommended me Knitr/Sweave, but it doesn't seem to produce tables in Latex style that I can copy into my Latex document; instead it produces directly pdf-tables. Am I missing something here? But that was only a sidenote, I am just looking for the best method to accomplish conversion from non-standard R-tables into Latex.

Community
  • 1
  • 1
user3032689
  • 627
  • 1
  • 10
  • 23
  • 3
    `xtable` is most common in my experience. But it's not at all clear what you want to know beyond what is in the question you link to. (Also a sidenote, you are missing something about knitr/Sweave; loosely speaking, it copies your R output into your LaTeX document directly and so makes the process much more seamless.) – Aaron left Stack Overflow Nov 25 '13 at 15:26
  • @ Aaron thanks for the comment. Ok I tried xtable and it seems to work with standard object. I will test it with more complex ones later and report the results. I see what Sweave does, but as far as I know there is no way to connect it to my Latex document. This means I had to use knitr/Sweave to make the whole thing instead? I like Texstudio, because of the shortcuts. Therefore I was looking for a solution which basically creates a Latex formatted table on the console or in a tex file. – user3032689 Nov 25 '13 at 19:05
  • `xtable` is pretty customizable; for complex output make sure you read the help pages both for `xtable` and `print.xtable`. And yes, you would do the whole thing in knitr/Sweave; that's exactly the point. But for just one or two tables that you don't expect to have to change later, I see how that could be overkill. – Aaron left Stack Overflow Nov 25 '13 at 20:15

0 Answers0