work_with_cache | R Documentation |
This function is designed so that you can work on your lesson inside the package cache without overwriting your personal library.
work_with_cache(profile = "lesson-requirements")
a function that will reset your R environment to its original state
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())
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.