Export Tables to LaTeX or HTML

Coerce data to LaTeX and HTML tables.


1.8-4 (2019-04-8)

  • Changes to spdep broke vignette Other Packages Gallery, reported by CRAN. Had to remove spdep, splm and sphet suggests and xtable functions, and references in OtherPackagesGallery

1.8-3 (2018-08-29)

  • Changed listOfTablesGallery vignette to exclude references to lsmeans since Russell Lenth has deprecated lsmeans, replacing it with emmeans which has support for tables using xtable based on listOfTables. lsmeans removed from Suggests in DESCRIPTION also.
  • Changed OtherPackagesGallery vignette example using the function impacts from spdep due to a change in the package spdep causing a failure ofr the example using gstslshet from sphet
  • Changed error messages to extract actual value of nrow(x), suggestion by Michael Chirico [email protected]
  • Corrected author field to properly represent author contributions, code supplied by Arni Magnusson [email protected]
  • Corrected call to print.xtable inside print.xtableFtable included arguments from call to print.xtableFtable. Absence of size argument was advised by Lluis Ramon, email March 4, 2016
  • Added patch from Martin Gubri, [email protected] to enable use of lagImpactMat from spdep in xtable method lagImpact.
  • Added patch to code in OtherPackagesGallery.Rnw supplied by Martin Gubri to avoid warnings in the spdep package example. Also fixed the vignette index entry.
  • Fixed number of columns in \multicolumn command in print.xtableList to deal with inclusion of row names. Previously was only appropriate for row names not included.

1.8-2 (2016-02-05)

  • Added function print.xtableMatharray to enable easy creation of LaTeX code to enable an array to be included in a document.
  • Added example to the gallery using sanitizing headings and row names to produce large bold headings and italic row names.
  • Added code from Martin Gubri, [email protected], to produce tables from the spatial econometrics packages, spdep, splm, and sphet.
  • Extracted sanitize functions from print.xtable as stand-alone functions, and exported them. Added helper functions as.is and as.math for assistance with sanitization (supplied by Stefan Edwards [email protected] in Feature Request #5303).
  • Added option to produce math style exponents when sanitizing numbers, as suggested by Don Armstrong [email protected], who also provided code
  • Fixed bug #6907. Warning was created when the data frame as no rows for type is 'html'. Added a test to create the matrix requested specially in that case. Original code was BTD2 <- matrix(align.tmp[(2-pos):(ncol(x)+1)], nrow = nrow(x), ncol = ncol(x)+pos, byrow = TRUE) which created a matrix with no rows, but gave a warning when there were no rows in the data frame being processed.
  • Fixed bug #6260. Accepted the change suggested by Claudius Loehnert, which was to replace { and } by \begingroup and \endgroup respectively as the delimiters when size was to changed in a table.
  • Added functions xtableList and print.xtableList to produce composite tables consisting of a number of subtables.
  • Added xtableFtable and print.xtableFtable to format flat tables produced by ftable. Included examples in the xtable gallery.
  • Produced new vignettes: 'The xtableList Gallery' to illustrate xtableList and print.xtableList; and 'The Other Packages Gallery' to illustrate methods for classes of objects from other packages.

1.8-0 (2015-11-02)

  • autoformat, xalign, xdigits, xdisplay from Arni Magnusson, added along with help file. Feature request #5686.
  • New argument 'auto' in xtable(), to call xalign, xdigits, and xdisplay at the time when xtable is created.
  • Updated xtableGallery vignette, now with TOC and revised examples.

1.7-4 (2014-09-11)

  • Changed tags in HTML to be all lower case, to be compatible with HTML5, part of feature request. (#5879)
  • Fixed booktabs bug (#2309), more of an enhancement really. Updated xtableGallery.snw to illustrate the change.

1.7-3 (2014-03-06)

  • Dealt with format.args bug (#4770). No code changes, but the documentation of print.xtable was changed to warn of the problem and to give a workaround as an example.

1.7-1 (2013-02-24)

  • Fixed logicals bug. (Req #1911)
  • Changed implementation of centering of tables. Instead of inserting a centered environment, now a \centering command is inserted. (Req #2104)
  • Allow for margin tables as possible with document class tufte-handout. An example of usage is found in the vignette. produced by margintable.Rnw which is in inst/doc. (Req #2168)
  • Added "timestamp" argument to print.xtable(). Set it to NULL if no timestamp is desired. (Req #2246)
  • Added "comment" argument to print.xtable(). Set it to FALSE to exclude the version and timestamp comment. (Req #2246)
  • Added "caption.width" argument. If not NULL then the caption is placed in a "parbox" of the specified width. (Req #2247)
  • Remove the check on whether the "floating.environment" is in a list of known floating environments. Users want to use floating environments from multiple options LaTeX packages. (Req #2488, #2578)

1.7-0 (2012-02-10)

  • Added some vectorization code to improve performance.
  • Let "caption" be length 2, in which case the second value is the short caption used when creating a list of tables.
  • Added "toLatex" method.
  • Included "print.xtable" in the exported methods in the NAMESPACE file.
  • Added "print.results" argument to "print" that can be used to suppress the printing.
  • Added "format.args" argument to "print" that can be used to pass additional arguments such as "big.marks" to "formatC()".
  • Added "rotate.colnames" and "rotate.rownames" arguments to "print.xtable".
  • Added "booktabs" argument to use the "\toprule", "\midrule", and "\bottomrule" tags from the Latex "booktabs" package rather than using "\hline" for all horizontal lines.
  • Added "scalebox" argument to include a "\scalebox" clause around the tabular environment with the specified value used as the scaling factor.
  • Added "width" argument to allow specification of the width value in tabular environments such as "tabularx".
  • Added "X" as an allowed alignment value in the "align()" replacement function.
  • Changed the "print.xtable()" arguments to use "getOption()" to check the options for a default value. This was suggested since "print.xtable()" has a lot of arguments that the user will typically leave unchanged between tables.
  • Added an "is.null()" check on the "table.placement" argument.
  • Added examples using the new arguments to the vignette.

1.6-0 (2011-10-07)

  • Allow "table*" as a value for "floating.environment" in print.xtable().
  • Fix bug under which multiple logical columns were formatted incorrectly.
  • Stop with an error if "xtable.table" is used on a table with more than two dimensions.
  • Add some newlines to "Rd" file to prevent lines from extending off the page in the PDF version of the help files.
  • Changed the maintainer to "Charles Roosen".
  • Created an "xtable" project on R-Forge.

1.5-6 (2009-10-30)

  • Support caption at the top in the LaTeX longtable.
  • Use options()$OutDec for decimal mark.

1.5-5 (2009-03-24)

  • Added html.table.attributes to set the attributed of the tag for HTML tables.
  • Accommodated logicals by converting to characters.
  • Add an extra space at end of each line for LaTeX tables.
  • Fixed typographical error in documentation.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.


1.8-4 by David Scott, 3 years ago


Browse source code at https://github.com/cran/xtable

Authors: David B. Dahl [aut] , David Scott [aut, cre] , Charles Roosen [aut] , Arni Magnusson [aut] , Jonathan Swinton [aut] , Ajay Shah [ctb] , Arne Henningsen [ctb] , Benno Puetz [ctb] , Bernhard Pfaff [ctb] , Claudio Agostinelli [ctb] , Claudius Loehnert [ctb] , David Mitchell [ctb] , David Whiting [ctb] , Fernando da Rosa [ctb] , Guido Gay [ctb] , Guido Schulz [ctb] , Ian Fellows [ctb] , Jeff Laake [ctb] , John Walker [ctb] , Jun Yan [ctb] , Liviu Andronic [ctb] , Markus Loecher [ctb] , Martin Gubri [ctb] , Matthieu Stigler [ctb] , Robert Castelo [ctb] , Seth Falcon [ctb] , Stefan Edwards [ctb] , Sven Garbade [ctb] , Uwe Ligges [ctb]

Documentation:   PDF Manual  

Task views: Reproducible Research

GPL (>= 2) license

Imports stats, utils

Suggests knitr, plm, zoo, survival

Imported by AICcmodavg, BEACH, BENMMI, BrailleR, CUFF, Clustering, Countr, CovSelHigh, Crossover, DAMisc, EasyHTMLReport, EdSurvey, GMDH2, HRM, IsoGene, JMbayes, MCPtests, MplusAutomation, MultBiplotR, NNTbiomarker, OpasnetUtils, PCMBase, PopGenReport, RItools, RSiena, RecordLinkage, ScottKnott, SixSigma, StableEstim, StatDA, TukeyC, WeibullFit, argo, bbdetection, bea.R, bpca, canprot, condir, confidence, corr2D, descr, dtwSat, dynr, ecd, emmeans, epitweetr, epos, fdth, flatness, gsDesign, gsrsb, hierarchicalDS, igate, implicitMeasures, inTrees, inlmisc, kutils, lfe, mastif, matlib, midrangeMCP, miscset, ncappc, orf, pipe.design, pkgmaker, poliscidata, predictoR, psychReport, qmethod, relSim, repmod, reproducer, robustlmm, sdcMicro, seasonalview, semTable, shiny, shinyHeatmaply, shinystan, sigInt, spduration, stacomirtools, statgenGxE, statgenSTA, survMisc, timeseriesdb, twang, twangContinuous, umx, x.ent, yamlet.

Depended on by A3, AmpliconDuo, BHTSpack, FactoClass, LinRegInteractive, PERMANOVA, RcmdrPlugin.Export, RcmdrPlugin.NMBU, TableMonster, generalCorr, klausuR, likert, multilevelPSA, nlcv, pamctdp, papeR, permPATH, reporttools, rplotengine, survSNP, surveillance.

Suggested by BayesFactor, CALIBERrfimpute, ClassDiscovery, EloChoice, ExtDist, GenAlgo, HiveR, IOHanalyzer, JoSAE, LSAmitR, LocalControl, MARSS, MODIStsp, MPSEM, NMF, NPC, PCRedux, PMCMRplus, RankAggreg, SBSA, SII, SIMMS, SVMMaj, SeleMix, SeqDetect, SeqFeatR, SharpeR, ShinyItemAnalysis, StMoMo, TailRank, Tcomp, TraMineR, TriMatch, WeightSVM, afex, aldvmm, aqp, arsenal, ascii, bcTSNE, blockTools, caper, caschrono, chipPCR, codingMatrices, coin, collin, cvam, e1071, evtree, fbRanks, firebehavioR, flextable, geex, geoknife, gets, ggPMX, glmmTMB, hamlet, hdm, icarus, ifaTools, itsadug, knitrBootstrap, kyotil, marqLevAlg, mcmc, micEconCES, microplot, mixedMem, mixl, multcomp, mvord, optmatch, ordinal, phangorn, postHoc, protViz, quanteda, rcdk, robustbase, rodeo, rsconnect, rtf, rticles, sadists, sapfluxnetr, soiltexture, sparseHessianFD, spdep, sqlutils, stationery, taRifx, tablesgg, tablet, texPreview, textreg, tscount, tukeytrend, visit, waterData.

Enhanced by JM, pampe.

See at CRAN