add_table | R Documentation |
Add a table in Rmarkdown suitable for publication in govspeak and in word/PDF
add_table(data, format.args = list(big.mark = ","), bold_cols = NULL)
data |
dataframe; dataframe of any size to be displayed as a table |
format.args |
additional format arguments to be passed to the table. |
bold_cols |
vector; vector of column names or column positions to be bolded in the table Defaults to comma thousands separation |
a markdown formatted table as a string
add_table(mtcars)
##Example with comma formatted values
add_table(data.frame(datasets::EuStockMarkets))
##Example with format.args set to null
add_table(data.frame(datasets::EuStockMarkets), format.args = NULL)
##Example with bold_cols set to a vector of column names
add_table(data.frame(datasets::EuStockMarkets), bold_cols = c("DAX", "SMI"))
##Example with bold_cols set to a vector of column positions
add_table(data.frame(datasets::EuStockMarkets), bold_cols = c(1, 2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.