-
Notifications
You must be signed in to change notification settings - Fork 5
/
setup.qmd
182 lines (133 loc) · 5.38 KB
/
setup.qmd
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
---
title: "Setup"
---
## Installation
::: {.panel-tabset group="language"}
## R
#### Required software
- [Download R](https://cran.r-project.org/) and install it using default options. (Note: choose the "base" version for Windows)
- [Download RStudio](https://www.rstudio.com/products/rstudio/download/#download) and install it using default options.
#### Setting up RStudio
After installing RStudio, change some of its default options (you only need to
do this once):
- From the upper menu go to <kbd>Tools</kbd> > <kbd>Global Options...</kbd>
- _Untick_ the option "Restore .RData to workspace on startup."
- Change "Save workspace to .RData on exit" option to "Never"
- Press <kbd>OK</kbd>
## Python
For this course we'll be using [Visual Studio Code](https://code.visualstudio.com). This provides support for various programming languages (including Python and R). It works on Windows, MacOS and Linux. It's also open-source and free.
Please refer to the [installation instructions](https://code.visualstudio.com/docs/python/python-tutorial) and make sure that you verify that Python code will run.
A brief sequence of events:
1. Install Visual Studio Code
2. Install the VS Code Python extension
3. Install a Python interpreter
* Windows: install from [Python.org](https://www.python.org/downloads/) or use the Microsoft Store
* MacOS: install the [Homebrew](https://brew.sh) package manager, then use this to install Python
* Linux: comes with Python 3, but needs `pip` to install additional packages
:::
## Packages
We will be using the following packages throughout this course:
::: {.panel-tabset group="language"}
## R
Install the required packages. Run the following code in the console:
```{r}
#| eval: false
install.packages("tidyverse")
install.packages("rstatix")
install.packages("ggResidpanel")
```
#### Testing your installation
On the RStudio panel named "Console" type `library(tidyverse)` and press <kbd>Enter</kbd>
A message similar to this should print:
```
── Attaching packages ─────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
✔ ggplot2 3.2.1 ✔ purrr 0.3.2
✔ tibble 2.1.3 ✔ dplyr 0.8.3
✔ tidyr 1.0.0 ✔ stringr 1.4.0
✔ readr 1.3.1 ✔ forcats 0.4.0
── Conflicts ────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
```
<p></p>
If instead you get the message:
```
Error in library(tidyverse) : there is no package called ‘tidyverse’
```
then your package installation did not work. Please ask the instructors for assistance before the course.
## Python
#### NumPy
The `numpy` package provides fundamental data science functionality to Python. For more information see: [https://numpy.org/doc/stable/#](https://numpy.org/doc/stable/#)
It can be installed via `pip`
```{python}
#| eval: false
pip install numpy
```
or `conda`
```{python}
#| eval: false
conda install -c conda-forge numpy
```
#### pandas
The `pandas` package provides data structures to Python. For more information see: [https://pandas.pydata.org/docs/getting_started/install.html](https://pandas.pydata.org/docs/getting_started/install.html).
It can be installed via `pip`
```{python}
#| eval: false
pip install pandas
```
or `conda`
```{python}
#| eval: false
conda install pandas
```
#### pingouin
The `pingouin` package provides statistical functionality to Python. For more information see: [https://pingouin-stats.org](https://pingouin-stats.org).
It can be installed via `pip`
```{python}
#| eval: false
pip install pingouin
```
or `conda`
```{python}
#| eval: false
conda install -c conda-forge pingouin
```
#### patchworklib
The `patchworklib` package provides an easy way for assembling figures. This package is required to run the course-specific `dgplots()` function. For more information see: [https://pypi.org/project/patchworklib/](https://pypi.org/project/patchworklib/).
It can be installed via `pip`
```{python}
#| eval: false
pip install patchworklib
```
#### plotnine
The `plotnine` packages provides a grammar of graphics to Python - an equivalent to the `ggplot2` package in R. For more information see: [https://plotnine.readthedocs.io/en/stable/#](https://plotnine.readthedocs.io/en/stable/#).
It can be installed via `pip`
```{python}
#| eval: false
pip install plotnine
```
or `conda`
```{python}
#| eval: false
conda install -c conda-forge plotnine
```
### scikit-posthocs
The `scikit-posthocs` package provides post-hoc functionality. For more information see: [https://scikit-posthocs.readthedocs.io/en/latest/](https://scikit-posthocs.readthedocs.io/en/latest/)
It can be installed via `pip`
```{python}
#| eval: false
pip install scikit-posthocs
```
### statsmodels
The `statsmodels` package provides statistical functionality. For more information see: [https://www.statsmodels.org/stable/index.html](https://www.statsmodels.org/stable/index.html).
It can be installed via `pip`
```{python}
#| eval: false
pip install statsmodels
```
or `conda`
```{python}
#| eval: false
conda install -c conda-forge statsmodels
```
:::