# NOT RUN {
# SETUP
old_path <- Sys.getenv("PROJECTS_FOLDER_PATH")
setup_projects(path = tempdir(), .Renviron_path = fs::path_temp(".Renviron"))
new_affiliation(department_name = "Math Dept.",
institution_name = "Springfield College",
address = "123 College St, Springfield, AB")
new_affiliation(department_name = "Art Department",
institution_name = "Springfield College",
address = "321 University Boulevard, Springfield, AB",
id = 42)
new_affiliation(department_name = "Central Intelligence Agency",
institution_name = "United States Government",
address = "888 Classified Dr, Washington DC")
new_affiliation(department_name = "Pyrotechnics",
institution_name = "ACME")
new_author(given_names = "Rosetta", last_name = "Stone",
affiliations = c(42, "Math"), degree = "PhD",
email = "slab@rock.net", phone = "867-555-5309", id = 8888)
new_author(given_names = "Spiro", last_name = "Agnew", degree = "LLB",
affiliations = "Art D", id = 13)
new_author(given_names = "Plato", id = 303)
new_author(given_names = "Condoleezza", last_name = "Rice", degree = "PhD",
affiliations = c(1, 42, "Agency", "ACME"), phone = "555-555-5555",
email = "condoleeza@ri.ce")
new_author(given_names = "Jane", last_name = "Goodall", degree = "PhD",
affiliations = 3, id = 5)
new_project(title = "Understanding the Construction of the United States",
short_title = "USA",
authors = c(13, "Stone", "zz", "303", "Jane Goodall"),
stage = 4, deadline = "2055-02-28", deadline_type = "submission",
path = "famous_studied/philosophers/rocks",
corresp_auth = "Stone", current_owner = "agnew",
make_directories = TRUE, use_bib = TRUE,
status = "waiting on IRB")
#############################################################################
# Reordering with unnamed arguments
reorder_affiliations(author = "RICE", "ACME", 42, after = 1)
# Reordering with named arguments
reorder_authors(project = 1, "Rosetta" = 99, `303` = 2, "5" = 1)
#############################################################################
# CLEANUP
Sys.setenv(PROJECTS_FOLDER_PATH = old_path)
fs::file_delete(c(fs::path_temp("projects"), fs::path_temp(".Renviron")))
# }
Run the code above in your browser using DataLab