Write R data to a LaTeX file as individual lines. Similar functions, such
as latex
in Hmisc
, write data to a LaTeX table, but there
may be instances where you don't want data in a table, hence this function.
Columns will printed in the order specified. The function adds a newline
between each item printed.
write_latex(df, file_name, ..., append = FALSE) write_latex_lines(df, file_name, ..., append = FALSE)
df | The dataframe, data.table, tibble, etc, containing the data to write to LaTeX. |
---|---|
file_name | File name of the tex file to write to. Overwrites any
existing files with the same name. If |
... | One or more unquoted, comma separated, variable names to write to LaTeX. If blank, all variables will be written to LaTeX. |
append | If |
This function does not add any LaTeX syntax or markup to the data being
printed. To add markup prior to printing, use the
latex_markup
function.
if (FALSE) { #write_latex(iris, file_name = "iris.tex", Species, Petal.Width) }