xtable

How to only show table caption once in “list of table” for a table split onto multiple pages

我与影子孤独终老i 提交于 2019-12-06 12:56:49
问题 I am using R packages ( xtable and knitr ) and Latex packages ( longtable and hyperref ) to prepare a document. One of my tables is very long and splits onto multiple pages. It turned out that the "List of Table" shows every page number at which this table appears, but all hyperlinks bring me to the beginning of this table. My question is, in "List of Table" how can I just show the first page number at which this table appears. \documentclass{article} \usepackage{longtable} \usepackage

xtable package: Skipping some rows in the output

和自甴很熟 提交于 2019-12-06 10:46:52
In the xtable output, if I want some rows to have nothing in them I will put NA 's in the elements of the matrix that correspond to the row that I want skipped. However this will lead to xtable output of something like & & & & & & & & \\ . What I want to know is how do I make it so it's ONLY \\ for that row that I wish to skip. Still not sure whether I understand right but I give it a shot. The most important assumption I'm making here is that your multicolumn rows in that template are always at the same spot. You use R to create a matrix or dataframe with no (useful) data in these rows. For

Labels in xtable captions for crossreferencing in lyx

风流意气都作罢 提交于 2019-12-06 06:35:06
问题 I am using pgfsweave with Lyx 1.6.8 and xtable. providing table captions by <<result=tex>>= print(xtable(<dataframe>,caption="Here is my caption")) @. How can I insert a label into the table caption that I can crossreference in the text from the lyx>Insert>Cross-reference menu? I have tried to insert>float>table and inserted print(xtable(<dataframe>,floating=FALSE)) and "Here is my caption" in the Table caption inner frame but this results in (literally): [float Table: <...Table ...> [Table 2:

header on each page of big table of xtable?

女生的网名这么多〃 提交于 2019-12-06 05:03:59
问题 How do you put on a big table of xtable the table header on each page?, So that is easier to read the table the table between pages. I use the following in Sweave: test.big<- xtable(test,label="table",caption='test') align(test.big) <- "|c|c|c|c|l|c|c|c|" print(test.big,tabular.environment='longtable',include.colnames = TRUE,floating=FALSE) Thanks for your answers 回答1: The longtable (LaTeX) package specification can be found at that URL. The section of code in the examples whose output

How do I print superscripts in a table using xtable and sweave?

為{幸葍}努か 提交于 2019-12-06 04:15:58
问题 So my problem statement is as follows : I have defined a data frame in my Sweave document (.Rnw extension) using the following code: <<label=table2_1,echo=FALSE>>= table2_1_rows <- c('Students with compulsory Evaluations', 'Teachers with compulsory evaluations1', 'Teachers without Evaluation2', 'Students without compulsory evaluations3' ) table2_1_data <- c(1,2,3,4) table2_1final <- data.frame(table2_1_rows,table2_1_data) @ <<label=tab1,echo=FALSE,results=tex>>= print(xtable(table2_1final

How can I omit interactions using stargazer or xtable?

五迷三道 提交于 2019-12-06 04:03:23
问题 Is it possible to omit interactions in stargazer using the omit option? Normally I would write the variable name into the omit=c('varname') but in the case of an interaction I do not know what to write. Any hints on that? How do you solve this problem in other packages like xtable ? \documentclass{article} \begin{document} %Load dataset and run regression << lm, echo=FALSE >>= load('dataset.RData') library(stargazer) lm1 <- lm(y~ x + factor(v)*z ,data=dataset) @ << table_texstyle, echo=FALSE,

inset \footnote{} into header with xtable and tabular.environment

蓝咒 提交于 2019-12-06 02:17:31
问题 Can I control the add.to.row command in xtable to place an \footnote{} in the LaTeX table output header? This is how far I've gotten it. (I would like to find a solution using xtable and not `Hmisc') require(xtable) x <- matrix(rnorm(60), ncol = 10) x.big <- xtable(x,label='tabbig', caption='Example of longtable') names(x.big) <- LETTERS[1:10] print(x.big,tabular.environment='longtable',floating=FALSE, add.to.row = list(pos = list(seq(1,nrow(x.big), by = 2), 0, 1), command = c("\\rowcolor

R: output a pivot-like table with subtotals

风流意气都作罢 提交于 2019-12-05 10:48:15
I'm trying to make a cross tabulation in R, and having its output resemble as much as possible what I'd get in an Excel pivot table. The objective is to replace a report made manually with Excel and Word with one automated with R Markdown; data wrangling and charts have been already taken care of but some tables are missing. So, given this code: set.seed(2) df<-data.frame("ministry"=paste("ministry ",sample(1:3,20,replace=T)),"department"=paste("department ",sample(1:3,20,replace=T)),"program"=paste("program ",sample(letters[1:20],20,replace=F)),"budget"=runif(20)*1e6) library(tables) library

sorting a table for latex output with xtable

可紊 提交于 2019-12-05 07:59:15
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 Pretty easy: sort() does not return a table, but an array. Use as.table() to solve your problem : a<-sample(letters,500,replace=T) b<-table(a) class(b) c<-sort(table(a),decreasing=T) class(c) d <- as.table(c) class(d) xtable(d) 来源: https://stackoverflow.com/questions/3661451/sorting-a-table-for-latex-output-with-xtable

Longtable in a knitr (PDF) document: using xtable (or kable)

时光总嘲笑我的痴心妄想 提交于 2019-12-05 05:17:39
I am new to knitr and I have had some very basic latex knowledge in the past, so I googled already hoping to find a solution that was already posted somewhere. However, I was not able to solve my problem. I am hoping someone will be kind enough to provide help. I have a data frame of 14 columns and many rows, let's say 60. Using the data I need to produce a PDF report in landscape layout and present this data frame as a table there. The closest solution I found is here at tex.stackexchange.com: LaTex Longtable spanning several pages I used some of the hints there. However, the table is not