xtable

adding commas into number for output

i'm outputting a dataframe to html via xtable now (tip to Shane, little nicer than r2html). I want to add commas to numbers in a couple columns of the table. I figured before i did my own paste hack I'd check if there is a built in way to do this. Anyone. ...

R: including model specifications in xtable(anova(...))

Hello R comrades: I have a bunch of loglinear models, which, for our purposes will just be glm() objects called mx, my, mz. I want to get a nicely-formatted xtable of the analysis of deviance, so naturally I would want to perform xtable(anova(mx, my, mz, test = "Chisq")). The vanilla output of xtable, however, doesn't include the mode...

Can you merge cells in an xtable in R

Hello, I've got some data (the output of a ddply function) that I want to present in an xtable for use somewhere else. calqc_table<-structure(list(RUNID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ANALYTEINDEX = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ID = structure(1:11, .Label = c("Cal A", "Cal B", "Cal C", "Cal D", "C...

How to put a newline into a column header in an xtable in R

I have a dataframe that I am putting into a sweave document using xtable, however one of my column names is quite long, and I would like to break it over two lines to save space calqc_table<-structure(list(RUNID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ANALYTEINDEX = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), ID = structur...

How to include multiple tables programmaticaly into a Sweave document using R

Hello, I want to have a sweave document that will include a variable number of tables in. I thought the example below would work, but it doesn't. I want to loop over the list foo and print each element as it's own table. % \documentclass[a4paper]{article} \usepackage[OT1]{fontenc} \usepackage{longtable} \usepackage{geometry} \usepac...

Sweave xtable: how to position tables between text?

I have a number of tables with text around them describing them. Something like this: This table shows blah blah... <<echo=FALSE, results=tex>>= print( xtable(x, caption = "blah", label = "tab:four", table.placement = "tbp", caption.placement = "top") , size = "small", table.placement="ht") @ This table shows blah blah....

How to include a Percent Symbol in an xtable caption using Sweave in R

I'm trying to use Sweave to generate a statistical report, and am trying to put a caption on an xtable, however if I include the percent symbol this breaks things. Some example code <<label=Analyte2_Results, results=tex, echo=FALSE>>= print(xtable(result[[2]], caption=paste(levels(vardata$Analyte)[1], " ...

Counts & Percentages in xTable, Sweave, R, cross tabulations

Edit: Building off of aL3xa's answer below, I've modified his syntax below. Not perfect, but getting closer. I still haven't found a way to make xtable accept \multicolumn{} arguments for columns or rows. It also appears that Hmisc handles some of these type of tasks behind the scenes, but it looks like a bit of an undertaking to underst...

sorting a table for latex output with xtable

I´m trying to produce a sorted table and export in to latex. However it seems xtable cannot cope with sorted tables. Suggestions? a<-sample(letters,500,replace=T) b<-table(a) c<-sort(table(a),decreasing=T) xtable(b) xtable(c) //M ...