writelog | R Documentation |
Function to write to a log file
writelog(
content,
logfile,
filetype = "text",
append = T,
verbose = F,
prefix = NULL,
include.row.names = F,
code = NULL,
data = NULL,
echo.code = TRUE,
pageLength = 10
)
content |
Content to write to the logfile - text or a dataframe/tibble-like object |
logfile |
Path to the file where the content will be written |
filetype |
'txt' or 'csv' - the type of file |
append |
Append to existing file? or overwrite existing contents |
verbose |
This is what it will be called in parent functions - verbose tells whether to actually write to the logfile or not This will allow us to write the code in the other functions and files without a bunch of if statements . |
writelog(df, 'logs/test.csv', filetype = 'csv', append = T)
writelog("# --- Test Log Statement --- #", 'logs/log.txt')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.