vein (version 0.7.8)

to_latex: creates a .tex a table from a data.frame

Description

\code\linkto_latex reads a data.frme an dgenerates a .tex table, aiming to replicate the method of tablegenerator.com

Usage

to_latex(df, file, caption = "My table", label = "tab:df")

Arguments

df

data.frame with three column.

file

Character, name of new .tex file

caption

Character caption of table

label

Character, label of table

Value

a text file with extension .tex.

See Also

\code\linkvein_notes \code\linklong_to_wide

Examples

Run this code
# NOT RUN {
{
df <- data.frame(pollutant = rep(c("CO", "propadiene", "NO2"), 10),
                 emission = vein::Emissions(1:30),
                 region = rep(letters[1:2], 15))
df
long_to_wide(df)
(df2 <- long_to_wide(df, column_fixed = "region"))
to_latex(df2)
to_latex(long_to_wide(df, column_fixed = "region"),
file = paste0(tempfile(), ".tex"))
}
# }

Run the code above in your browser using DataLab