forked from dcossyleon/basic-workshop-site
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.Rmd
210 lines (145 loc) · 7.4 KB
/
index.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
---
title: "Pakistan R workshop"
site: distill::distill_website
description: null
---
<br>
<center></center>
<br>
#### You can find all of our workshop information on this site.
<br>
# When & Where
**Date:** 16th - 20th September 2019, 08:00-17:30
**Location:** Pakistan
<br>
# Set up & Pre-work
To participate in this workshop, you will need to make sure you:
<br>
### Download R and RStudio
Download the latest versions
* R https://cran.r-project.org/
* RStudio https://www.rstudio.com/products/rstudio/#Desktop
Once R and Rstudio are both installed, if you open RStudio and things have gone according to plan then in the console you will see something like the following:
```
R version 3.6.1 (2019-07-05) -- "Action of the Toes"
Copyright (C) 2019 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
```
### Install Necessary Packages
Open RStudio and paste the following code into your console, then press Enter to run it:
```{r, eval = FALSE}
# Download packages from CRAN
install.packages(c("devtools", "knitr", "magrittr", "sf", "sp", "rmarkdown", "usethis", "ggplot2", "dplyr", "zoo", "reshape2", "scales", "maptools",
"readxl", "rgdal"))
```
These are the main packages for the workshop.
If we require more then we can either install them from the web or from e.g. a USB if we have them.
<br>
# Learning Objectives
From basic principles to advanced graphics. You will be able to
* Read-in, explore and write data sets
* Clean messy data and rearrange for analysis
* Plot and map different types of data
<br>
# Organizers
* Nathan Green
* David Jorgensen
<br>
# Schedule
Our agenda is below.
<br>
#### DAY 1 (17-9): Introduction
Pre-reading
- `r xfun::embed_file('Thieme-2018-Significance.pdf', text = "R generation, Significance Magazine")`
<br>
* Workshop introduction 9:15-10:00
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 1/9-15--10-00_workshop into/workshop-intro.pdf'))`
* Introduction to R 10:15-12:30
+ history and motivation
+ R for data analysis
+ RStudio GUI
+ Console, scripts
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 1/10-15--12-30_intro to R/intro RStudio.pdf'))`
+ `r xfun::embed_file(here::here('presentations/day 1/10-15--12-30_intro to R/R_overview_slides.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 1/10-15--12-30_intro to R/exercises-1_intro-R_vectors.pdf'), text = "starter exercises")`
+ `r xfun::embed_file(here::here('exercises/day 1/10-15--12-30_intro to R/exercises-1_intro-R_types.pdf'), text = "types exercises questions")`
+ `r xfun::embed_file(here::here('exercises/day 1/10-15--12-30_intro to R/exercises-1_intro-R_types_root.pdf'), text = "types exercises solutions")`
+ `r xfun::embed_file(here::here('exercises/day 1/10-15--12-30_intro to R/exercises-1_intro-R_M_E_root.pdf'), text = "M & E data intro exercises")`
* Basic types 13:30-15:00
+ base
+ dates and times
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 1/13-30--15-00_types/types_loops.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 1/13-30--15-00_types/exercises-1_intro-R_lists.pdf'))`
* Data transformation 15:30-17:00
+ Missing values
+ Indexing, sorting, filtering
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 1/15-30--17-00_NAs and indexing/Subsetting-logicals.pdf'))`
+ `r xfun::embed_file(here::here('presentations/day 1/15-30--17-00_NAs and indexing/Missing data, factors and dates in R.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 1/15-30--17-00_NAs and indexing/exercises-1_intro-R_index.pdf'))`
+ `r xfun::embed_file(here::here('exercises/day 1/15-30--17-00_NAs and indexing/exercises-1_intro-R_logicals.pdf'))`
+ `r xfun::embed_file(here::here('exercises/day 1/15-30--17-00_NAs and indexing/exercises-1_intro-R_NAs.pdf'))`
<br>
#### DAY 2 (18-9): Handling data
Pre-reading
- `r xfun::embed_file('v59i10.pdf', text = "Tidy Data, Wickham")`
- `r xfun::embed_file('peerj-preprints-3183.pdf', text = "Data organization in spreadsheets, Broman")`
<br>
* Day 2 recap 9:30-10:00
* Pre-processing/munging 10:15-12:15
+ base: join, merge, aggregate
+ slides
+ `r xfun::embed_file(here::here('presentations/day 2/10-15--12-15_merge join dplyr/joins and melts.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 2/10-15--12-15_merge join dplyr/exercises_join-and-melt.pdf'))`
+ `r xfun::embed_file(here::here('exercises/day 2/10-15--12-15_merge join dplyr/exercises-1_intro-R_binding.pdf'))`
* Basis plots and tables 13:15-15:30
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 2/13-15--15-30_basic plots tables/intro M&E plots.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 2/13-15--15-30_basic plots tables/exercises-3_plots_content.pdf'), text = "base R plots questions")`
+ `r xfun::embed_file(here::here('exercises/day 2/13-15--15-30_basic plots tables/exercises-3_plots_root.pdf'), text = "base R plots answers")`
* reading and cleaning data 15:45-17:00
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 2/15-45--17-00_reading cleaning/intro-to-data-cleaning.pdf'))`
+ `r xfun::embed_file(here::here('presentations/day 2/15-45--17-00_reading cleaning/read-data.pdf'))`
+ `r xfun::embed_file(here::here('presentations/day 2/15-45--17-00_reading cleaning/Data wrangling-dplyr.pdf'))`
<br>
#### DAY 3 (19-9): Outputs
Pre-reading
- `r xfun::embed_file('jeabehav00088-0140.pdf', text = "How to look at data: A review of John W. Tukey's exploratory data analysis, Church")`
- `r xfun::embed_file('1903.09512.pdf', text = "Effective visual communication for the quantitative scientist, Vandemeulebroecke")`
<br>
* Day 3 recap 9:30-10:00
* Plotting 10:15-12:30
+ ggplot2
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 3/10-15--12-30_ggplot/plots ggplot.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 3/10-15--12-30_ggplot/exercises-ggplot.pdf'), text = "intro ggplot questions")`
+ `r xfun::embed_file(here::here('exercises/day 3/10-15--12-30_ggplot/exercises-ggplot_solutions.pdf'), text = "intro ggplot answers")`
+ `r xfun::embed_file(here::here('exercises/day 3/10-15--12-30_ggplot/M_E-plots-in-ggplot2.pdf'), text = "M & E data ggplots")`
* Maps 13:30-14:45
+ slides:
+ `r xfun::embed_file(here::here('presentations/day 3/13-30--14-45_maps/Mapping spatial data.pdf'))`
+ exercises:
+ `r xfun::embed_file(here::here('exercises/day 3/13-30--14-45_maps/Spatial_data.html'))`
+ `r xfun::embed_file(here::here('exercises/day 3/13-30--14-45_maps/Spatial_data_answers.html'))`
* Putting it all together 14:00-16:00
+ plots for presentations
+ maps for presentations