-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathexercise_pdf.Rmd
49 lines (38 loc) · 1.23 KB
/
exercise_pdf.Rmd
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "PDF version of exercises"
output:
html_document:
toc: false
---
```{r, include=FALSE}
library(knitr)
library(stringr)
knitr::opts_chunk$set(message=FALSE, warning=FALSE, eval=TRUE, echo=FALSE)
suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(stringr))
source('reveal.R')
```
\
Click on the links below to download pdf versions of the exercises.
\
```{r, reveal, echo=FALSE, eval = isFALSE(show_exercise)}
cat("Exercises will be released as the course progresses")
```
\
```{r, results='asis', eval = isTRUE(show_exercise)}
ex_text <- c(": Getting to know R and RStudio", ": Basic R operations",
": Importing and manipulating dataframes",
": Visualising data using base R and lattice graphics",
": Basic statistics in R",
": Basic programming in R")
dir <- "exercises"
file_name <- list.files(dir) %>%
sort %>%
grep("[*.zip]", ., value=TRUE)
link_name <- file_name %>%
gsub("\\.pdf", "", .) %>%
gsub("_", " ", .) %>%
str_to_sentence(.)
paste0("- [", link_name, ex_text, "](", "exercises/", file_name, "){target='_blank'}") %>%
cat(sep="\n\n")
```