as_latex {tatoo} | R Documentation |
Convert a Table to Latex Code
Description
as_latex()
converts an R Object (currently Tatoo_table
s and
data.frame
s) to latex code.
save_pdf()
is a wrapper around as_latex()
for directly saving
an R object to ‘.pdf’.
view_pdf()
is another wrapper for directly viewing an R
Object's pdf representation on a pdf viewer (powered by open_file()
).
Usage
as_latex(x, ..., kable_options = default_kable_options())
save_pdf(
x,
outfile,
...,
overwrite = FALSE,
papersize = "a4paper",
orientation = "portrait",
keep_source = FALSE,
template = system.file("templates", "save_tex.Rmd", package = "tatoo")
)
view_pdf(x, ...)
Arguments
x |
a |
... |
passed on to methods |
kable_options |
|
outfile |
|
overwrite |
If |
papersize |
|
orientation |
|
keep_source |
When saving a ‘pdf’, also put the Latex source in the same directory. |
template |
Latex template for the desired output. Use the template file supplied in this package if you want to create your own. |
Details
as_latex()
and co. are designed to produce nice looking output with a
minimum of user input required. This is useful if you want a quick preview or
printout of a table. If you need customized Latex the output, you should
take a look at the packages kableExtra::kableExtra, xtable, or
huxtable.
Value
as_latex()
returns a character
scalar of Latex code
save_pdf()
returns a the path to the saved file as character
scalar.
view_pdf()
returns NULL
(invisibly)
Latex Packages
as_latex
requires that the following Latex packages are installed on your
system:
\usepackage{booktabs} \usepackage{longtable} \usepackage{threeparttablex}
See Also
Other as_latex methods:
as_latex.Composite_table()
,
as_latex.Mashed_table()
,
as_latex.Tagged_table()
,
as_latex.Tatoo_report()
,
as_latex.data.frame()
Examples
as_latex(iris)
## Not run:
view_pdf(iris) # Not supported on all systems
## End(Not run)