Chapter 2 Getting Set Up
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.
## 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)
2.1 Data sets
Obtain some extra data sets that will be used in this session.
2.2 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.
(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).
2.3 Alternative 2
If you get really stuck, try https://rstudio.cloud/
There you should be able to run the code above with no problem.