Questions tagged [xtable]

A function of an R package of the same name, used to convert an R object into an object that may be printed as a LaTeX or HTML table.

This function extracts tabular information from x and returns an object of class "xtable". The nature of the table generated depends on the class of x. For example, aov objects produce ANOVA tables while data.frame objects produce a table of the entire data.frame. One can optionally provide a caption (called a title in HTML) or label (called an anchor in HTML), as well as formatting specifications. Default values for align, digits, and display are class dependent.

The available method functions for xtable are given by methods(xtable). Users can extend the list of available classes by writing methods for the generic function xtable. These methods functions should have x as their first argument with additional arguments to specify caption, label, align, digits, and display. Optionally, other arguments may be present to specify how the object x should be manipulated. All method functions should return an object whose class if given by c("xtable","data.frame"). The resulting object can have attributes caption and label, but must have attributes align, digits, and display. It is strongly recommended that you set these attributes through the provided replacement functions as they perform validity checks.

The xtable package is a creation of David Dahl with contributions and suggestions from many others.

396 questions
0
votes
0 answers

Extra text with HTML Tables in R Studio

Using the R Html script in R Studio I'm trying to insert a table, however when I knit the file together I get 16 rows of ## before the table shows up. I have echo=FALSE and message = FALSE set. Here's what it looks like: What else am I missing?…
GregRousell
  • 997
  • 2
  • 13
  • 23
0
votes
1 answer

xtable formatting each column differently

I am trying to create a summary of my table using summaryBy, that looks like the following year qtr FX_mean FX_median 2000 1 1000000 1000000 2000 2 2000 1000 2000 3 3000 2000 The FX_mean and…
rajvijay
  • 1,641
  • 4
  • 23
  • 28
0
votes
0 answers

creating LaTex table from xtable in R

I have a very basic question however I'm stumped. I am creating a LaTex table in R and I am having trouble with actually outputting the real table. Here is example code borrowed from: …
Elizabeth
  • 199
  • 1
  • 4
  • 13
0
votes
1 answer

generate regression tables for slidify?

What is the best way to generate good looking regression tables for slidify? --- ## Custom Tables ```{r, results = "asis", echo = FALSE} library(xtable) OLS <- lm(hp ~ wt, mtcars) print(xtable(OLS), type="html",…
Ignacio
  • 7,646
  • 16
  • 60
  • 113
0
votes
0 answers

How can I 'stack' a data frame so that the summary of the variables can be presented in half the columns but preserving its unique names?

The question was phrased weirdly, but I'll try my absolute best to explain it thoroughly. I have a data frame that was constructed from a time series object. The time series object was constructed like so: std<- ts(baser, frequency=12,…
erasmortg
  • 3,246
  • 1
  • 17
  • 34
0
votes
1 answer

Use of reactive dataframe in a function

I am trying to build an app in shiny. I have three sliders and i get the min max values of the sliders in a dataframe using reactive as below: sliderValues <- reactive({ data.frame( Name =…
user3285140
  • 33
  • 1
  • 6
0
votes
2 answers

Vertical lines/borders in generated table is not continuous (R+Latex+Sweave+xtable)

I am creating a report in latex using R and Sweave. The table is generated using xtable. Following is the code used to generate the table <>= tabulatedVal <- getStatTableMacro(portfolio, normalizingRow) createdXTable <-…
john_zac
  • 1,241
  • 2
  • 11
  • 16
0
votes
1 answer

Formating xtable based on condition with lapply

I want to color cells in a Latex table created with xtable. I have a data frame that looks like: a <- data.frame(a=c(seq(1:100)),b=c(seq(1:100)),b=c(seq(1:100))) Now I want every cell colored individually based on its value. I created the…
user2386786
  • 725
  • 9
  • 25
0
votes
1 answer

Transpose xtable while formatting number of digits

I have a dataframe with 2 rows (pre/post treatment) and 11 columns that I want to display as an 11x2 table. The following does the job nicely: print(xtable(t(df))) However, I can't figure out how to control the number of digits and also accomplish…
Bryan
  • 1,771
  • 4
  • 17
  • 30
0
votes
0 answers

Indicate the level of significance in an R xtable

In a regression analysis R "rates" each independent variable with its level of significance (i.e. with stars **), e.g.: Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.0869 0.6504 10.897 < 2e-16 * X1 …
Oliver Amundsen
  • 1,491
  • 2
  • 21
  • 40
0
votes
0 answers

Function for generating LaTeX tables from R summaries (using RPy)

I am trying to obtain a latex table with the summary of a lme4.lmer() run. There are a number of R packages which claim to do this. However, in my experience none of them could. Here is a run-down: xtable - doesn't seem to take my input, neither…
TheChymera
  • 17,004
  • 14
  • 56
  • 86
0
votes
2 answers

Suppressing column names within a matrix and looping function

I am attempting to create my first custom function in R (yay!). I've got something that sort of works now but I think it could be improved. Basically, I want to create my own custom table within R that can be run through xtable for a final report. I…
graywolf97
  • 33
  • 3
0
votes
1 answer

Manipulating xtable entry and print sideways

I have successfully created a table, that I can run as follows: library(xtable) print(x, floating.environment='sidewaystable', inlude.rownames=F) Please note, that the table only fits onto the page if it is rotated sideways. I would now like to…
Joanne Demmler
  • 1,406
  • 11
  • 31
0
votes
2 answers

How to cluster values in a heatmap in R?

Using the following data: > mytable<-read.delim("mytable.csv",sep=",",header=T) > class(mytable) [1] "data.frame" > mytable count lang1 lang2 1 908446 ar ar 2 96 ar bg 3 73 ar bo …
blehman
  • 1,870
  • 7
  • 28
  • 39
0
votes
0 answers

wrap text in latex xtable

I am using knitr and xtable to generate a table and I would like to wrap some text. The code is below. I would like to wrap the 3rd column (Exposure Groups). The column width looks ok but the text are not wrapped. What is wrong with the…
Amateur
  • 1,247
  • 6
  • 20
  • 30
1 2 3
26
27