The following packages are required for this lesson. Base R
packages are not included here since they are pre-installed.
- Ensure that
R
is up to date - you can download it here - Ensure that RStudio is up to date - you can download it here
I recommend installing sf
before any addition packages are installed:
install.packages("sf")
To test whether the installation has gone smoothly, you can execute the following two lines of code in your R
console:
library(sf)
nc <- st_read(system.file("shape/nc.shp", package="sf"))
The output should look like so:
> library(sf)
Linking to GEOS 3.6.1, GDAL 2.1.3, PROJ 4.9.3
> nc <- st_read(system.file("shape/nc.shp", package="sf"))
Reading layer `nc' from data source `/Users/prenercg/Library/R/3.5/library/sf/shape/nc.shp' using driver `ESRI Shapefile'
Simple feature collection with 100 features and 14 fields
geometry type: MULTIPOLYGON
dimension: XY
bbox: xmin: -84.32385 ymin: 33.88199 xmax: -75.45698 ymax: 36.58965
epsg (SRID): 4267
proj4string: +proj=longlat +datum=NAD27 +no_defs
If you get installation errors related to missing dependencies, you may need to install the latest verion of RTools (currently RTools 35) if you are a Windows user. macOS users may need to install the GDAL complete framework from the kyngchaos website (currently GDLAD 2.4 Complete).
Once you have sf
installed, the remaining general packages can be installed with the following syntax:
install.packages(c("tidyverse", "here", "knitr", "remotes", "rmarkdown", "stlcsb", "usethis"))
These packages are described below.
These are most easily installed by installing the entire tidyverse.
dplyr
- tools for data wranglingggplot2
- tools for plotting
These will not be referred to directly during the session but are needed for the notebook to work correctly.
knitr
- create documents from R notebooksrmarkdown
- write in Markdown syntax
here
- file path management
Not all of these packages are available through CRAN at this time.
compstatr
- must be installed via GitHub usingremotes
gateway
- must be installed via GitHub usingremotes
postmastr
- must be installed via GitHub usingremotes
stlcsb
- available through CRAN (and included in the above install code chunk)
The three packages that must be installed via GitHub can be installed using the following syntax:
remotes::install_github(c("slu-openGIS/compstatr", "slu-openGIS/gateway", "slu-openGIS/postmastr"))