Last data update: 2014.03.03

R: Produce LaTeX Tables
HSAURtableR Documentation

Produce LaTeX Tables

Description

Generate longtable LaTeX environments.

Usage

HSAURtable(object, ...)
## S3 method for class 'table'
HSAURtable(object, xname = deparse(substitute(object)), pkg = NULL, 
    ...)
## S3 method for class 'data.frame'
HSAURtable(object, xname = deparse(substitute(object)), pkg = NULL,
    nrows = NULL,  ...)
## S3 method for class 'tabtab'
toLatex(object, caption = NULL, label = NULL, 
    topcaption = TRUE, index = TRUE, ...)
## S3 method for class 'dftab'
toLatex(object, pcol = 1, caption = NULL, 
    label = NULL, rownames = FALSE, topcaption = TRUE, index = TRUE, 
    ...)

Arguments

object

an object of table or data.frame.

xname

the name of the object.

pkg

the package object comes from, optionally.

nrows

the number of rows actually printed for a data.frame.

caption

the (optional) caption of the table without label.

label

the (optional) label to be defined for this table.

pcol

the number of parallel columns.

rownames

logical, should the rownames be printed in the first row without column name?

topcaption

logical, should the captions be placed on top (default) of the table?

index

logical, should an index entry be generated?

...

additional arguments, currently ignored.

Details

Based on the data in object, an object from which a Latex table (in a longtable environment) may be constructed (via toLatex) is generated.

Value

An object of class tabtab or dftab for which toLatex methods are available.

toLatex produces objects of class Latex, a character vector, essentially.

Examples


  data("rearrests", package = "HSAUR2")
  toLatex(HSAURtable(rearrests), 
          caption = "Rearrests of juvenile felons.", 
          label = "rearrests_tab")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HSAUR2)
Loading required package: tools
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HSAUR2/HSAURtable.Rd_%03d_medium.png", width=480, height=480)
> ### Name: HSAURtable
> ### Title: Produce LaTeX Tables
> ### Aliases: HSAURtable toLatex.tabtab toLatex.dftab HSAURtable.table
> ###   HSAURtable.data.frame
> ### Keywords: misc
> 
> ### ** Examples
> 
> 
>   data("rearrests", package = "HSAUR2")
>   toLatex(HSAURtable(rearrests), 
+           caption = "Rearrests of juvenile felons.", 
+           label = "rearrests_tab")
index{rearrests data@Robject{rearrests} data}
egin{center}
egin{longtable} { rrrr }
caption{Robject{rearrests} data. Rearrests of juvenile felons. label{rearrests_tab}}
\
 & & multicolumn{ 2 }{c}{Robject{ Juvenile court }} \
Robject{ Adult court } &   & Rearrest & No rearrest \
  & Rearrest & 158 & 515 \
  & No rearrest & 290 & 1134 \
end{longtable}
end{center}
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>