Skip to content

Commit 5402f04

Browse files
committed
update setup alt installation
1 parent 3392086 commit 5402f04

1 file changed

Lines changed: 77 additions & 10 deletions

File tree

learners/setup.md

Lines changed: 77 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,71 @@ While this may sound scary, it is **far more common** to run into issues due to
9696

9797
:::::::::::::::::::::::::::::
9898

99-
### 2. Install the required R packages
99+
### 2. Check and Install Build Tools
100+
101+
Some packages require a complementary set of tools to build them.
102+
Open RStudio and **copy and paste** the following code chunk into the
103+
[console window](https://docs.posit.co/ide/user/ide/guide/code/console.html),
104+
then press the <kbd>Enter</kbd> (Windows and Linux) or <kbd>Return</kbd> (MacOS) to execute the command:
105+
106+
```r
107+
if(!require("pkgbuild")) install.packages("pkgbuild")
108+
pkgbuild::check_build_tools(debug = TRUE)
109+
```
110+
111+
We expect a message like the one below:
112+
113+
```output
114+
Your system is ready to build packages!
115+
```
116+
117+
If the build tools are not available, this will trigger an automated install.
118+
119+
1. Run the command in the console.
120+
2. Don’t interrupt it—wait until R prints the confirmation message.
121+
3. Once that’s done, restart your R session (or just restart RStudio) to ensure the changes take effect.
122+
123+
If the automatic installation **does not** work, you can manually install them according to your operating system.
124+
125+
::::::::::::::::::::::::::::: tab
126+
127+
### Windows
128+
129+
Windows users will need a working installation of `Rtools` in order to build the package from source.
130+
`Rtools` is not an R package, but a software you need to download and install.
131+
We suggest you to follow:
132+
133+
- **Install `Rtools`**. Download the `Rtools` installer from <https://cran.r-project.org/bin/windows/Rtools/>. Install with default selections.
134+
- Close and reopen RStudio so it can recognize the new installation.
135+
136+
### Mac
137+
138+
Mac users require two additional steps as detailed in this [guide to Configuring C Toolchain for Mac](https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Mac):
139+
140+
- Install and use [`macrtools`](https://mac.thecoatlessprofessor.com/macrtools/) to setup the C++ toolchain
141+
- Enable some compiler optimizations.
142+
143+
### Linux
144+
145+
Linux users require specific details per distribution. Find them in this [guide to Configuring C Toolchain for Linux](https://github.com/stan-dev/rstan/wiki/Configuring-C-Toolchain-for-Linux).
146+
147+
:::::::::::::::::::::::::::::
148+
149+
::::::::::::: callout
150+
151+
### Environment Check
152+
153+
This step requires administrator privileges to install software.
154+
155+
If you do not have admin rights in your current environment:
156+
157+
- Try running the tutorial on your **personal machine** where you have full access.
158+
- Use a **preconfigured development environment** (e.g. [Posit Cloud](https://posit.cloud/)).
159+
- Ask your **system administrator** to install the required software for you.
160+
161+
:::::::::::::
162+
163+
### 3. Install the required R packages
100164

101165
<!--
102166
During the tutorial, we will need a number of R packages. Packages contain useful R code written by other people. We will use packages from the [Epiverse-TRACE](https://epiverse-trace.github.io/).
@@ -128,12 +192,14 @@ These installation steps could ask you `? Do you want to continue (Y/n)` write `
128192
If you get an error message when installing {epidemics}, try this alternative code:
129193

130194
```r
131-
if(!require("devtools")) install.packages("devtools")
132-
133-
devtools::install_github("epiverse-trace/epidemics")
195+
install.packages("epidemics", repos = c("https://epiverse-trace.r-universe.dev", "https://cloud.r-project.org"))
134196
```
135197

136-
**What to do if an Error persist?**
198+
:::::::::::::::::::::::::::::
199+
200+
::::::::::::::::::::::::::: spoiler
201+
202+
### Do you need a GitHub Personal access token (PAT)?
137203

138204
If the error message keyword include an string like `Personal access token (PAT)`, you may need to [set up your GitHub token](https://epiverse-trace.github.io/git-rstudio-basics/02-setup.html#set-up-your-github-token).
139205

@@ -162,20 +228,21 @@ gitcreds::gitcreds_set()
162228
usethis::git_sitrep()
163229
```
164230

165-
Try again installing {epidemics}:
231+
Try again installing {epiparameter}:
166232

167233
```r
168-
if(!require("devtools")) install.packages("devtools")
169-
170-
devtools::install_github("epiverse-trace/epidemics")
234+
if(!require("remotes")) install.packages("remotes")
235+
remotes::install_github("epiverse-trace/epiparameter")
171236
```
172237

173238
If the error persist, [contact us](#your-questions)!
174239

175-
:::::::::::::::::::::::::::::
240+
:::::::::::::::::::::::::::
176241

177242
You should update **all of the packages** required for the tutorial, even if you installed them relatively recently. New versions bring improvements and important bug fixes.
178243

244+
### 4. Verify the installation
245+
179246
When the installation has finished, you can try to load the packages by pasting the following code into the console:
180247

181248
```r

0 commit comments

Comments
 (0)