forked from r-spatialecology/ialena-2020
-
Notifications
You must be signed in to change notification settings - Fork 0
/
prerequisites.Rmd
52 lines (37 loc) · 1.55 KB
/
prerequisites.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
---
title: "Introduction to landscape ecology with R"
output:
html_document: default
pdf_document: default
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE,
dev = "png",
dev.args = list(type = "cairo-png"))
```
## Prerequisites
### Equipment and software requirements
Attendees are expected to use their own computers with a working version of R (version 3.6 or higher) and RStudio (version 1.2 or higher) installed.
R and RStudio are supported by PC, Linux, and Mac OS and can be downloaded for free by following these links
http://www.r-project.org/ and https://www.rstudio.com/products/rstudio/download/#download.
### R packages
Run the code below in R to install all of the required R packages.
```r
install.packages(c("landscapemetrics", "sf", "dplyr", "spData", "usethis", "remotes")
install.packages("spDataLarge", repos = "https://nowosad.github.io/drat/", type = "source")
remotes::install_github("mtennekes/tmaptools", upgrade = TRUE)
remotes::install_github("mtennekes/tmap", upgrade = TRUE)
remotes::install_github("rspatial/raster", upgrade = TRUE)
```
### Check if it works
Afterwards, run the code below (you should see the map as a result):
```{r}
library(tmap)
library(landscapemetrics)
tm_shape(landscape) +
tm_graticules() +
tm_raster()
```
Please see https://datacarpentry.org/geospatial-workshop/setup.html for instructions on how to install geospatial library dependencies.
<!-- ### Questionnaire -->
<!-- Please also fill the form at https://forms.gle/sdvLXcqFaqHBGBZF8. -->