forked from mdsumner/polar-mapping-oghub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_getting_set_up.Rmd
45 lines (26 loc) · 1.45 KB
/
01_getting_set_up.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
# Getting Set Up {#setup}
We need the following packages installed, using `remotes` is the best way to install as it will not re-install any package if it's already up to date.
```{r setup, eval = FALSE}
## make sure we have the packages we need
if (!requireNamespace("remotes", quietly = TRUE)) {
install.packages("remotes")
}
req1 <- c("ggplot2", "maps", "maptools", "raster", "sp", "dplyr", "rgdal")
remotes::install_cran(req1)
```
## Data sets
Obtain some extra data sets that will be used in this session.
```{r extra-data, eval=FALSE}
if (!file.exists("polar-mapping.Rdata")) {
download.file("https://github.com/mdsumner/polar-mapping-oghub/raw/master/data-raw/polar-mapping.Rdata",
"polar-mapping.Rdata", mode = "wb")
}
load("polar-mapping.Rdata")
```
## Alternative 1
If you have problems and can't get R set up as above, try this Binder badge - just click it and you should get a ready-to-go Rstudio session where the code already works.
[](https://mybinder.org/v2/gh/mdsumner/polar-mapping-oghub/master?urlpath=rstudio)
(It shouldn't take more than a few minutes to launch, but note that a session will only last for 12 hours or so and you will need to keep active with the session, it will time out after 10min or so).
## Alternative 2
If you get really stuck, try https://rstudio.cloud/
There you should be able to run the code above with no problem.