-
Notifications
You must be signed in to change notification settings - Fork 1
/
bootstrap.R
33 lines (23 loc) · 907 Bytes
/
bootstrap.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# add library(tidyverse) here so that it's loaded for the first Session
# even before they have ready about loading libraries
suppressPackageStartupMessages(library(tidyverse))
errfun <- function(cond) {
warning(cond)
warning("\n\nSomething went wrong - please see a member of staff before continuing.")
}
tryCatch(
{
lifesavrdir <- paste0("~/lifesavR", format(Sys.Date(), "%Y"))
clonedreporesult <- system(paste0("git clone https://github.com/benwhalley/lifesavR/ ", lifesavrdir ))
stopifnot(clonedreporesult==0)
rstudioapi::filesPaneNavigate(paste0(lifesavrdir, "/exercises"))
message("Switching to the exercises folder.")
message("Success!")
rm(list = ls()) # clear environment
},
error = errfun,
warning = errfun
)
# TODO
# add options(dplyr.summarise.inform = FALSE) to .RProfile?
# add message reminding to load tidyverse to .Rprofile? Plus similar?