-
Notifications
You must be signed in to change notification settings - Fork 0
/
reproducibility_ws_setup.Rmd
147 lines (109 loc) · 6.4 KB
/
reproducibility_ws_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
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
---
title: "Reproducible research"
subtitle: "Workshop setup instructions"
params:
make_version: 4.3
git_version: 2.32.0
---
1. Make sure that you have installed the [latest versions of R and RStudio](r_and_rstudio.html).
2. Install the tidyverse and the renv packages by copying the following code into the Console, after the prompt `>`
```{r install-tidyverse, eval = FALSE}
if (!require(tidyverse)) install.packages("tidyverse")
if (!require(renv)) install.packages("renv")
```
3. Download the data file we will use during the workshop by clicking on the following button and save it in your Desktop or another convenient location.
```{r echo = FALSE}
data_file <- read.csv("https://raw.githubusercontent.com/EDUCE-UBC/educer/main/data-raw/data_intro_ws.csv")
downloadthis::download_this(data_file,
output_name = "data",
output_extension = ".csv",
button_label = "Download data",
button_type = "default",
has_icon = TRUE,
icon = "fa fa-save",
class = "hvr-sweep-to-left",
csv2 = FALSE
)
```
## {.tabset .tabset-fade .tabset-pills}
### Windows 10
#### Terminal
Install [GitBash](https://gitforwindows.org/), which emulates Bash (a Unix shell) in Windows. All command-line instructions should be completed in GitBash and not the native Windows Command Prompt.
#### Git
1. Basic Git was installed automatically with your GitBash Terminal.
2. Test that Git is properly installed by opening GitBash and typing `git --version` <kbd>enter</kbd>. This should populate the window with information on your version of Git such as
```
git version `r params$git_version`.windows.1
```
3. Once you've installed Git, you'll need to activate it in RStudio:
- Open RStudio and go to Tools > Global Options > Git/SVN
- Click "Enable version control interface for RStudio projects"
- If necessary, enter the path for your Git executable where provided.
- The path should look approximately like `C:/Program Files/Git/bin/git.exe`
- Warning: do **not** use `C:/Program Files/Git/cmd/git.exe`. The path should include `bin`, **not** `cmd`.
- Warning: the path should end in `git.exe`, **not** in `git-bash.exe`
- Restart RStudio.
![](images/setup_git_windows.png)
4. Finally, you need to change your environment variables to ensure you can run R scripts from GitBash:
- Open the Control Panel > System Properties > Advanced. In Windows 10 you can find this by searching for "environment".
- Click on the "Environment Variables..." button to open the settings for the environment variables.
- In the window that pops up select the `PATH` variable and click the "Edit" button below it.
- In the next window that pops up click the "Browse" button and navigate to the folder that contains the `Rscript.exe` file. The path should look approximately like `C:/Program Files/R/R-4.1.1/bin/Rscript.exe`.
- Test that everything worked by restarting GitBash and typing `Rscript --version` <kbd>enter</kbd>. This should populate the window with information information on your version of R such as
```{bash, echo = FALSE}
Rscript --version
```
#### GitHub
1. If you do not already have one, sign up for a [GitHub account](https://github.com/).
2. Configure your GitHub user name and email (the email address you used to register on GitHub). To do this, open GitBash and type:
```{bash eval = FALSE}
git config --global user.name '<your GitHub username>'
git config --global user.email '<[email protected]>'
```
#### Make
1. Download the [Make *without guile* (version `r params$make_version`)](https://sourceforge.net/projects/ezwinports/files/), file name `` `r paste0("make-", params$make_version, "-without-guile-w32-bin.zip")` ``.
2. Unzip the folder.
3. Copy all of its contents to `C:\Program Files\Git\mingw64\`.
Merge all of the contents of the folders but do NOT overwrite/replace any existing files.
4. Check that Make is installed by typing `make --version` <kbd>enter</kbd> in GitBash. This should populate the window with information on your version of Make such as
```
GNU Make `r params$make_version`.
Built for Windows32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL verison 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
```
### macOS
#### Terminal
The native Terminal on macOS is Unix-based and, therefore, can be used in this workshop. You can access it under Applications > Utilities > Terminal.app
#### Git
1. Download and [install Git](https://git-scm.com/downloads).
2. Test that Git is properly installed by opening your Terminal and typing `git --version` <kbd>enter</kbd>. This should populate the window with information on your version of Git such as
```
git version `r params$git_version`
```
3. Once you've installed Git, you'll need to activate it in RStudio:
- Open RStudio and go to Tools > Global Options > Git/SVN
- Click "Enable version control interface for RStudio projects"
- If necessary, enter the path for your Git executable where provided (see picture below).
- Restart RStudio.
![](images/setup_git_mac.png)
#### GitHub
1. If you do not already have one, sign up for a [GitHub account](https://github.com/).
2. Configure your GitHub user name and email (the email address you used to register on GitHub). To do this, open the Terminal and type:
```{bash eval = FALSE}
git config --global user.name '<your GitHub username>'
git config --global user.email '<[email protected]>'
```
#### Make
1. Download and install the Mac command line developer tools (including Make) by opening your Terminal and typing: `xcode-select --install` <kbd>enter</kbd>. In the window that opens, click "Install" to allow the installation of the full developer’s packet.
2. Check that Make is installed by typing `make --version` <kbd>enter</kbd> in your Terminal. This should populate the window with information on your version of Make such as
```
GNU Make `r params$make_version`.
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
This program built for i386-apple-darwin11.3.0
```