Coerces data.frame to document and then to PDF.
Extra arguments are passed to makePreamble
.
as.document.data.frame
will try to guess an
appropriate width and length( wide
, long
)
for the page, but you may need something wider
or
longer
, especially if you adjust aesthetics.
Negative values for wider
and longer
are meaningful.
# S3 method for data.frame
as.pdf(
x,
rules = c(2, 1, 1),
walls = 0,
grid = FALSE,
rowgroups = factor(rownames(x)),
colgroups = factor(names(x)),
rowbreaks = if (grid) breaks(rowgroups) else 0,
colbreaks = if (grid) breaks(colgroups) else 0,
rowgrouprule = 0,
colgrouprule = 0,
rowcolors = NULL,
rowgrouplabel = " ",
charjust = "left",
numjust = "right",
justify = ifelse(sapply(x, is.numeric), numjust, charjust),
colwidth = NA,
paralign = "top",
na = "",
verbatim = ifelse(sapply(x, is.numeric), TRUE, FALSE),
escape = "#",
reserve = TRUE,
trim = TRUE,
source = NULL,
file = NULL,
source.label = "source: ",
file.label = "file: ",
basefile = FALSE,
tabularEnvironment = "tabular",
footnote.size = "tiny",
geoLeft = "1mm",
geoRight = "1mm",
geoTop = "1mm",
geoBottom = "1mm",
wide = NULL,
long = NULL,
wider = 0,
longer = 0,
thispagestyle = command("thispagestyle", args = "empty"),
pagestyle = command("pagestyle", args = "empty"),
prolog = NULL,
epilog = NULL,
stem = "latexpdf-doc",
dir = ".",
clean = TRUE,
...
)
data.frame
numeric; will be recycled to length 3. indicates number of horizontal lines above and below the header, and below the last row.
numeric, recycled to length 2. Number of vertical lines on left and right of table.
logical, whether to have lines between rows and columns
a vector as long as nrow(x), non-repeats trigger horizontal lines
a vector as long as names(x), non-repeats trigger vertical lines
numeric: a manual way to specify numbers of lines between rows (ignores grid and rowgroups)
numeric: a manual way to specify numbers of lines between columns (ignores grid and colgroups)
number of lines to set off row group column, if rowgroups supplied as character
number of lines to set off col group header, if colgroups supplied as character
character vector of color names, recycled as necessary to color all rows (NULL: no color); not compatible with rowgroups
character string (at least one character) to label rowgroup column
default justification for character columns
default justification for numeric columns
manual specification of column justifications: left, right, center, or decimal (vector as long as ncol(x))
manual specification of column width. (vector of length ncol(x).) Overrides justify where not NA.
used with colwidth to align paragraphs: top, middle, or bottom.
string to replace NA elements
whether to use verbatim environment for numeric fields. Makes sense for decimal justification; interacts with trim
and justify
.
symbol used by `verb' command as delimiter. A warning is issued if it is found in non-NA text.
substitute escape sequences for LaTeX reserved characters
passed to the format command: true by default, so that alignment is the responsibility of just the tabular environment arguments
optional source attribution
optional file name
optional text to preceed source if specified
optional text to preceed file if specified
if TRUE, strip path from file for display purposes
default tabular
; consider also longtable
font size for source and file attributions
geometry package: left margin
geometry package: right margin
geometry package: top margin
geometry package: bottom margin
nominal page width in mm
nominal page length in mm
additional page width in mm
additional page lenth in mm
thispagestyle command
pagestyle command
latex markup to include before x
latex markup to include after x
the stem of a file name (no extension)
output directory
whether to delete system files after pdf creation
passed eventually to makePreamble
and reserve
as.pdf.character
as.pdf.document
as.document.data.frame
as.tabular.data.frame
as.png.data.frame
if (FALSE) as.pdf(head(Theoph))
if (FALSE) as.pdf(Theoph[0,])
Run the code above in your browser using DataLab