work_with_cache: (Experimental) Work with the package cache

Description Usage Value Examples

View source: R/utils-renv.R

Description

This function is designed so that you can work on your lesson inside the package cache without overwriting your personal library.

Usage

1
work_with_cache(profile = "lesson-requirements")

Value

a function that will reset your R environment to its original state

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
if (interactive() && fs::dir_exists("episodes")) {
  library("sandpaper")
  done <- work_with_cache()
  print(.libPaths())
  # install.packages("cowsay") # install cowsay to your lesson cache
  # cowsay::say() # hello world
  # detach('package:cowsay') # detach the package from your current session
  done() # finish the session 
  # try(cowsay::say()) # this fails because it's not in your global library
  print(.libPaths())
}

zkamvar/sandpaper documentation built on Nov. 25, 2021, 1:16 p.m.