save_table: Wrapper to write dataframe to disk as a csv and use chunk...

Description Usage Arguments Author(s)

Description

This function is a wrapper for write_csv. It will write a dataframe to disk. If no table_name is provided and the function is called from within a knitr code chunk, the table_name variable will take the same value as the chunk label. By default, the directory is a 'tables' subdirectory to the working directory, which suits my directory structure nicely. Could of course be customized.

Usage

1
2
save_table(df, table_name = opts_current$get("label"), directory = "tables",
  row_names = FALSE)

Arguments

df

a dataframe

table_name

the name of the file to write. By default, it will be same as the label of the chunk from which it was called

directory

the directory in which the file will be written

row_names

include rownames in the .csv-file? FALSE by default.

Author(s)

Daniel Lindholm


dlindholm/doctoR documentation built on May 15, 2019, 9:18 a.m.