knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(sdcLog) user_options <- options()
I want to use sdc_log() on a main.R script which calls several other scripts via source() in the order I need in my analysis. But the contents from the other R scripts are not logged. How can I log the outputs from the subordinated scripts in the same log file?
First, replace all calls to source() with sdc_log().
Then, create a file connection:
r
file_connection <- file("path/to/my/log", open = "w")
Specify destination = file_connection in all calls to sdc_log().
Run sdc_log() on you main.R script.
Close the file connection via close(file_connection).
This vignette will be extended as users have more questions.
options(user_options)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.