similar to: formatting tables with long column names via package:xtable within Sweave

Displaying 20 results from an estimated 5000 matches similar to: "formatting tables with long column names via package:xtable within Sweave"

2004 Jan 08
2
Sweave & xtable
I am just starting to learn Sweave (really neat tool). I am pretty early in the learning curve (I had to think a moment ago whether a # or % was the appropriate comment character). I have successfully incorporated simple graphics and outputs, but am having trouble getting a latex (xtable) table to function properly. Latex is seemingly treating the xtable code as input or verbatim text. That
2008 May 07
1
Sweave, xtable and font size
Hi, I'm using Sweave with xtable to generate Latex tables. My problem is that some of the tables are too wide, and I would like to use the tiny font for these tables, but not for the others nor for the text. I can't work out how to accomplish that. The Latex code below does what I want it to, but I have to insert the "\tiny{" and the closing "}" by hand. It
2009 Dec 09
1
Exporting Contingency Tables with xtable
Dear R-philes: I am having an issue with exporting contingency tables with xtable(). I set up a contingency and convert it to a matrix for passing to xtable() as shown below. v.cont.table <- table(v_lda$class, grps, dnn=c("predicted", "observed")) v.cont.mat <- as.matrix(v.cont.table) Both produce output as follows: observed predicted uh uh~ uh 201
2011 Jun 01
1
xtable with conditional formatting using \textcolor
Hello list, I'm doing a table with scores and I want include colors to represent status of an individual. I'm using sweave <<results=tex>>= and xtable but I can't get a result I want. My attemps are #----------------------------------------------------------------------------- # code R da <- data.frame(id=letters[1:5], score=1:5*2) col <- function(x){
2012 Feb 26
1
Sweave Print xtable
Hi, I'm working with Sweave and I have some trouble generating table. The R code is: print(xtable(myTable, caption ="", label="tab:myTab", digits=3), tabular.environment='tabular', floating=TRUE, caption.placement="top",size="\\scriptsize") and the resulting LaTeX table is: \begin{table}[ht] \begin{center} \caption{Principal
2008 Sep 24
1
paste in xtable
Dear R help: I am trying to use paste(), within an ifelse() statement to insert latex commands into an object that has been created using xtable(). I cannot make the strings behave as I would like, the '\t' is creating a tab, the usual method of '\\t' is not working either - nor is any series of backslashes. The xtable object, I think, automatically alters the strings. How
2011 Oct 28
1
xtable with \begin{tabular} and only.contents
I have found that I like having my captions and labels in my latex document rather than having them contained in my xtable output file (I haven't fully gone to sweave yet). I know I can do something like this by using the 'only.contents' argument in xtable. Unfortunately, the only.contents argument also removes the \begin{tabular}{rrrrrr} & \end{tabular} (in the example below) of
2010 Nov 22
1
Problem setting the number of digits in xtable
DEar list members, I am currently using Sweave with LaTeX which is great. I can use xtable for formatting outp of tables but I have a problem setting the number of decimals in xtables when used with dataframe. I have found an example on the net ith matrix and it works. For example this works : > > tmp <- matrix(rnorm(9), 3, 3) > > xtmp <- xtable(tmp) > > digits(xtmp)
2007 Jun 20
2
"xtable" results doesn't correspond to data.frame
Dear useRs, Am trying to use xtable on the following data.frame and I don't get what I expect: example.table <- data.frame(rbind( c("Gender"," "," "," "), cbind(rep(" ",2),c("Male","Female"),c(3.0,4.0),c(3/7,4/7)) )) colnames(example.table) <- c(" "," ","number of
2007 Sep 13
1
Problem using xtable on an array
Hi all I know about producing a minimal example to show my problem. But I'm having trouble producing a minimal example that displays this behaviour, so please bear with me to begin with. Observe: I create an array called model.mat. Some details on this: > str(model.mat) num [1:18, 1:4] -0.170 -0.304 -2.617 2.025 -1.610 ... - attr(*, "dimnames")=List of 2 ..$ : chr
2013 May 24
2
xtable() with booktabs option problem
I could have sworn that yesterday xtable(file, booktabs = TRUE) was giving me toprule , midrule and bottomrule outout. Today : library(xtable) aa <- table( sample(letters[1:9], 100, replace = TRUE)) xtable(aa, booktabs = TRUE) gives me \begin{table}[ht] \centering \begin{tabular}{rr} \hline & V1 \\ \hline a & 15 \\ b & 11 \\ c & 13 \\ d &
2009 Jun 17
1
Horisontal line in xtable
Hi everyone (Pardon the incorrect terminology of my previous post: "vertical line...). I have created a function that uses xtable to print table of frequencies and percentages with a heading and some sample information (the sample size and missing values). The function and example data is below. I want a horisontal line that separates the results from the sample information i.e. a
2004 Jun 22
1
Using xtable with summaries of lm objects
Hi all Suppose I do the following: set.seed(1000) library(xtable) x <- runif( 10 ) y <- 1 + 2*x + rnorm( length(x) ) test.lm <- lm( y ~ x ) summary( test.lm ) xtable ( summary( test.lm ) ) The final xtable output follows: % latex table generated in R 1.8.1 by xtable 1.2-2 package % Tue Jun 22 09:56:36 2004 \begin{table}[ht] \begin{center} \begin{tabular}{rrrrr} \hline &
2010 Mar 13
2
Un poco de ayuda con xtable
Hola, buenas tardes: Necesitaba un poco de socorro con xtable, si fuese posible. Mi problema es que quiero 'formatear' específicamente algunas celdas de una tabla generada con xtable y no soy capaz. Detallo el problema de ejemplo: vv<-rbind(c(1,1,0,1),c(0,0,1,1)) vv[2,3]<-<-paste("\\textbf{",vv[2,3],"}",sep="") xtable(vv) > xtable(vv) % latex
2004 Aug 28
1
Handling of special characters by xtable
It seems that xtable does not escape special characters such as % (which indicates a comment line in LaTeX). Try these few lines for example: > library(xtable) > q<-data.frame(quantile(rnorm(100))) > xtable(q) This produces: % latex table generated in R 1.9.1 by xtable 1.2-3 package % Sat Aug 28 16:11:05 2004 \begin{table}[ht] \begin{center} \begin{tabular}{rr} \hline &
2004 May 13
2
xtable without rownames
When I tried to read all the entries (after searching the FAQ) for "row names xtable", I get START-INFO-DIR-ENTRY * R FAQ: (R-FAQ). The R statistical system ... ... xtable* Export data to LaTeX and HTML tables. ... For dropping the row names of a matrix `x', it may be easier to use `rownames(x) <- NULL', similarly for column ...
2010 Jul 02
1
help with the xtable package
HI, Dear R community, I am using the xtable to create the table, but how can I see the table? The following is the codes I used: > data(tli) > tli.table <- xtable(tli[1:10, ]) > digits(tli.table)[c(2, 6)] <- 0 > print(tli.table, floating = FALSE) % latex table generated in R 2.11.0 by xtable 1.5-6 package % Thu Jul 1 20:43:43 2010 \begin{tabular}{rrlllr} \hline &
2007 Apr 27
1
Problem with formatted xtable in R 2.5.0
Dear R-Devel subscriber, I encountered the following problem for tex-formatted table with xtable(). Suppose I do want the following matrix as a table in LaTeX: library(xtable) a11 <- "\\color{green}\\textbf{big green}" a21 <- "\\color{red}\\textbf{big red}" a12 <- "\\color{green}green" a22 <- "\\color{red}red" A <- matrix(c(a11, a21, a12,
2012 Feb 01
2
Problem with xtable- rescaling a table
Dear R users, I am new to Latex and I am using the R package xtable to generate tables. I want to produce a table that is very long. in the landscape format, but I would need to rescale the table so that it fits in the page. xtable enables me to have the landscape format, but I cannot rescale it, and there seems to be a problem, if I use scalebox in Latex on my output produced with stable and the
2007 Mar 01
4
question about xtable and Hmisc
I would like to get rid of the row numbers using xtable and latex. The commands d = cbind(1:10,rep(1:2,5)) ans = xtable(d) latex(ans) gives output containing \begin{tabular}{rrr} \hline & 1 & 2 \\ \hline 1 & 1.00 & 1.00 \\ 2 & 2.00 & 2.00 \\ 3 & 3.00 & 1.00 \\ 4 & 4.00 & 2.00 \\ 5 & 5.00 & 1.00 \\ 6 & 6.00 &