Skip to contents

Function used to pass through code to the .Rprofile

Usage

rprofile(config)

Arguments

config

configuration object from config::get()

Value

Called for its side effects. Directory paths and autos are added to the search path based on your config.

Examples

# temp location to store configuration files
tmpdir <- tempdir()
print(tmpdir)
#> [1] "/tmp/RtmpKPwpGu"

# Create an example config file
hierarchy <- "default:
  paths:
    data: !expr list(DEV = '/demo/DEV/username/project1/data',
                     PROD = '/demo/PROD/project1/data')
    output: !expr list(DEV = '/demo/DEV/username/project1/output',
                       PROD = '/demo/PROD/project1/output')
    programs: !expr list(DEV = '/demo/DEV/username/project1/programs',
                         PROD = '/demo/PROD/project1/programs')"

writeLines(hierarchy, file.path(tmpdir, "hierarchy.yml"))

rprofile(config::get(file = file.path(tmpdir, "hierarchy.yml")))
#> Attaching paths to envsetup:paths