Module 4: GIS basics in R for paleontologists
Schedule
From | To | What |
---|---|---|
9:00 | 9:30 | General introduction to GIS in R |
9:30 | 10:15 | Setting up the Spatial toolchain + programming problems |
10:15 | 10:30 | Coffee break |
10:30 | 11:45 | Vector spatial data basics |
11:45 | 13:00 | Lunch Break |
13:00 | 14:15 | Raster spatial data basics |
14:15 | 14:30 | Coffee break |
14:30 | 15:30 | Paleogeographic reconstruction - gplates, rgplates |
15:30 | 15:45 | Coffee break |
15:45 | 17:30 | Paleogeographic reconstructions continued |
The R-markdown
- template file: 0_rmarkdown_template.Rmd
Rendering the .Rmd file
- Option 1: Open the Rmd file in RStudio and click on the knit button in the grahical interface
- Option 2: Open an R console and run this:
# if you do not have rmarkdown:
# install.packages("rmarkdown")
# once you have it installed
rmarkdown::render(file.path(path_to_dir, "0_rmarkdown_template.Rmd"))
… where path_to_dir
is the path to the directory where you put the .Rmd file (either relative or absolute path). You can set the output
field in the front matter to either pdf_document
or html_document
.
Note that you might be required to install some additional tools to build these files.
Slides
Useful links
- https://r-spatial.org/
- Spatial Data Scince with applications in R
- Simple Features for R
- Guide to terra
Required packages
Attaching R packages from variables
onePackage <- c("terra")
library(onePackage, character.only=TRUE)
Vector information (object view)
Example Data
- Natural Earth land polygons: ne_land.zip
- World Administrative Boundaries: world_admin.zip
- IUCN Range data (Chameleons): CHAMELEONS.zip
Example Code
- Example code for vector data: 1_vector.R
- Code updated after class for vector data: 1_vector_clean.R
Raster information (field view)
Example Data
- The ETOPO1 Global relief model (resampled to 1x1 degree): etopo1.tif
- WorldClim Bioclimatic variables:wc2.1_10m_bio.zip
Example Code
- Original code for raster data: 2_raster.R
- Code updated after class for raster data: 2_raster_clean.R
Paleogeography
GPlates-related
rgplates R package
Code
- Code to connect to the GPlates web service with rgplates: 3_rgplates_gws.R