/
setup.Rmd
77 lines (60 loc) · 2 KB
/
setup.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
---
title: "Setup for Divvy data analysis"
author: "Peter Carbonetto"
output: html_document
---
<!-- The file analysis/chunks.R contains chunks that define default settings
shared across the workflowr files. -->
```{r read-chunk, include=FALSE, cache=FALSE}
knitr::read_chunk("chunks.R")
```
<!-- Update knitr chunk options -->
```{r knitr-opts-chunk, include=FALSE}
```
<!-- Insert the date the file was last updated -->
```{r last-updated, echo=FALSE, results='asis'}
```
<!-- Insert the code version (Git commit SHA1) if Git repository exists and R
package git2r is installed -->
```{r code-version, echo=FALSE, results='asis'}
```
To reproduce the results on your own computer, please follow these
setup instructions.
## Setup instructions
Download or clone the
[git repository](https://github.com/stephenslab/wflow-divvy)
on your computer.
Download the Divvy data files and copy the files to the "data"
directory. I have provided a script `code/retrieve_divvy_data.sh` that
will automatically retrieve the data files and move them to the
expected location. Alternatively, you can view this script and follow
the steps by hand. After completing this step, these files should be
in the data directory:
```
Divvy_Stations_2016_Q1Q2.csv
Divvy_Stations_2016_Q3.csv
Divvy_Stations_2016_Q4.csv
Divvy_Trips_2016_04.csv
Divvy_Trips_2016_05.csv
Divvy_Trips_2016_06.csv
Divvy_Trips_2016_Q1.csv
Divvy_Trips_2016_Q3.csv
Divvy_Trips_2016_Q4.csv
```
Install [R](http://cran.r-project.org) and/or
[Rstudio](https://www.rstudio.com/products/rstudio).
Install the R packages used for the analyses:
```{r install-pkgs, eval=FALSE, echo=TRUE}
install.packages(c("data.table","ggplot2"))
```
Once you have completed these steps, you may run the R code. When
running the code, make sure your working directory is set to the
"analysis" directory, e.g.,
```{r working-dir}
getwd()
```
## Session information
This is the version of R and the packages that were used to generate
the results from the R Markdown documents.
```{r session-info}
```