Skip to content

Combining Sweave and LaTeX-packages?

4 messages · Frank E Harrell Jr, oliver, Gabor Grothendieck

#
Hello,

a while ago I asked for collaboration support
R <-> LaTeX.

I got some answers, and Sweave was one, to use
the Hmisc package another one.

Both  have their advantages and drawbacks.

At the moment I would absolutely prefer Sweave,
because the inclusion is done automatically, and I do not
have to \include{myRTeXFile} by myself.

One (THE) drawback is, that the results of commands
normally will be included as verbose text.
This is ok for many applications, but when printing data-frames,
this often looks unclear for the eye.

But Hmisc's latex() function(s) create always *.tex-files.
Then I have to use the include-statement by myself and also
my working directory will be filled up with *.tex files...

I just want to have the TeX-output to appear in the *.tex,
that Sweave creates.

I found out, that Sweave can also be used in a way, that
it interprets a code chunk as TeX-stuff, for example
the output of a function can create LaTeX-stuff and then it
will be used "as is" for TeXing (with option "results=tex").

This is fine.

I have written a simple function that does a simple table layout, but so
far is not very flexible. It just prints a data-frame in LaTeX-syntax in
a tabular environment, but alignment is fixed so far.


Before I might invest more time to develop a more flexible
set of functions (and then making a package out of it) I
want to know, if there is already something like this, so I do not
have to invent the already existing wheel again.

If there is such a package (or even more than one),
which would you recommend?

If there is nothing for this application,
what general rules would you give, for developing such a package,
or a package in general? Should I use S4-OOP-style?

Ciao,
   Oliver
#
Oliver Bandel wrote:
No, read the latex function's documentation more closely.  Specifying 
file='' will result in tex code appearing inline so results=tex will 
work fine with Sweave.

Frank

  
    
#
Zitat von Frank E Harrell Jr <f.harrell at vanderbilt.edu>:

[...]
[...]


Ok, (mea culpa! ;-)) thank you a lot.

Then I will explore thie package more closely!
Possibly printing the whole documentation will make sense
(because I dislike reading long texts at the screen).

Thanks again!


Ciao,
   Oliver
#
Also check out the xtable package.

On Sun, Dec 21, 2008 at 12:09 PM, Oliver Bandel
<oliver at first.in-berlin.de> wrote: