-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_make.R
More file actions
28 lines (22 loc) · 1.13 KB
/
_make.R
File metadata and controls
28 lines (22 loc) · 1.13 KB
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
## Run all files to prepare "Getting Started with Git and GitHub for R Users" workshop
makeStart <- Sys.time()
# Setup
library(here)
here()
# Render the presentation, Base R exercises and data.table exercises & solutions
rmarkdown::render(here("Presentation", "Getting-Started-with-Git-and-GitHub-for-R-Users.Rmd"),
clean = TRUE, output_dir = here("Presentation"))
# Create a PDF version of the slides to share
library(webshot)
htmlSlides <- paste0("file://",
normalizePath(here("Presentation",
"Getting-Started-with-Git-and-GitHub-for-R-Users.html")))
webshot(htmlSlides, here("Presentation", "Getting-Started-with-Git-and-GitHub-for-R-Users.pdf"),
vwidth = 960, vheight = 540, zoom = 0.9, cliprect = "viewport")
# Create image of first slide to include as part of README.md
htmlSlide1 <- paste0(htmlSlides, "#1")
webshot(htmlSlide1, here("Presentation", "images", "Git-GitHub-R-Title-Slide.png"),
delay = 5, vwidth = 640, vheight = 360, zoom = 1.5, cliprect = "viewport")
# Actual time taken to run this file.
makeEnd <- Sys.time()
difftime(makeEnd, makeStart)