[R] LaTeX Output (was: HTML Output from R)

Knut Suebert ksueber at gwdg.de
Thu Sep 30 22:24:49 CEST 1999


Kurt Hornik schrieb:
> >>>>> Terry J Westley writes:
> 
> > I recommend that you model your HTML write function after
> > write.table().  It's got many of the features you'd like
> > to have and also will give you some good hints on how
> > to handle row and column names and avoid that "forbidden"
> > for loop.
> 
> Yes, this is a very good suggestion.  Eventually, one could have
> something like write.table(..., format = "HTML") (or LaTeX).

Hello.

I wrote  a library(tex), it may be not as clean as a write.table(...,
format="LaTeX"), but it is quite powerful, I think. 

It takes the colnames as default, extra (and rotated) headers are possible
(also grouping the header over some cols), grouping the body automatically
by inserting clines if a value in selected cols changes, using longtable,
booktabs, rotating, adjusting cols at the decimal comma (german, but to use
comma or point to split is a thing on the TeX-side)... the result is written
to stdout or to a file.

possible options are:

textable <- function(data,
                     caption="",
		     header=NA, headerunits=NA, # a list would be better 
		     xheader=NA, 
		     rotlab=NA,rotlabheight="6em",
		     label="", sepcols=NA,
                     kommata=NA, nosplit=integer(0),
                     file=NULL, na.mask=T, sideways=F,
		     tabletype="normal",
                     arraystretch=NA
	             ){

The code is weird, it's one the way to be rewritten. So it could be a good
time to do it clean as write.table... I'll try to start next week. 

Bye,
Knut
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list