Frequently Asked Questions

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

library(sdcLog)

user_options <- options()

  1. 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)


Try the sdcLog package in your browser

Any scripts or data that you put into this service are public.

sdcLog documentation built on March 20, 2022, 1:06 a.m.