# NOT RUN {
# Wrapped in if (interactive()) because this function is interactive by nature.
if (interactive()) {
# If you have a projects() project open, just run it:
email_authors()
# Otherwise, specify a project:
###########################################################################
# Setup
old_home <- Sys.getenv("HOME")
old_ppath <- Sys.getenv("PROJECTS_FOLDER_PATH")
temp_dir <- tempfile("dir")
dir.create(temp_dir)
Sys.unsetenv("PROJECTS_FOLDER_PATH")
Sys.setenv(HOME = temp_dir)
setup_projects(path = temp_dir)
new_author("Rhonda", "Rondale", email = "ronda.rondale@co.uk")
new_author("Betty", "Betts", email = "betty@co.uk")
new_project("Inventing the Ring of Power", authors = c("Betty", "Ron"))
###########################################################################
email_authors("Ring of Power")
###########################################################################
# Cleanup (or just restart R)
Sys.setenv(HOME = old_home, PROJECTS_FOLDER_PATH = old_ppath)
}
# }
Run the code above in your browser using DataLab