dataFrameToCode | R Documentation |
programming tool to convert a data.frame in memory to a character vector representing code for inclusion into programs.
dataFrameToCode(
dataframe,
differentLines = "\n\t",
includeData = TRUE,
includeRowNames = TRUE,
trim = NA,
...
)
dataframe |
data.frame to be converted to code. Can be with and without data. |
differentLines |
parameter that allows inclusion of new line and tab 'characters' in the produced character vector. The intended effect is not seen when printing 'normally', use cat() for this. |
includeData |
default is TRUE, it will then include the data itself in the produced character string. If FALSE, then it will not. |
includeRowNames |
default is TRUE, is only used when includeData = TRUE, it will then add an extra line of code with rownames(...) <- ... |
trim |
if NA (default) nothing is done, else should be value "both", "left" or "right". It will then cause all vectors to be white space trimmed on the specified site. See ?stringr::str_trim for more details. Note that trimming is done after formatting, so may undo settings like wide = x' |
... |
is used to transfer settings to the base format() function. See ?format for more info. Note that these settings are applied to all vector types! |
a character vector.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.