Logo Lanfrica

BritishTrustForOrnithology/CISCA-R-exercises

Domaine:

geospatial
Créateur:
Bri
Hôte:
R exercises given as part of the CCI-funded Citizen Science in Africa training course # CISCA-R-exercises This repository contains R exercises and required data files for practicals given as part of the Citizen Science in Africa training program. The course was a collaboration between BTO, the Tropical Biology Association, Cambridge Zoology Museum and the Nairobi National Museum, Kenya. It was funded by the Cambridge Conservation Initiative's Collaborative Fund. The purpose of the exercises was to introduce participants to R, showing how it can be used as part of a workflow to import and clean citizen science data and produce maps. For simplicity the code uses as few packages as possible and concentrates on use of the sf package for manipulating spatial data and the ggplot2 package for making map images. Exercises 1 to 13 were given in Nairobi, Kenya (April 2019) so use maps and data relating to Kenya. Subsequent exercises were written after the course to help with outstanding issues and cover other parts of Africa. # Requirements Before starting please ensure you have R version >=3.5.1 and the following packages installed (version indicates version used at time of writing): * ggplot2 (3.2.1) * ggthemes (4.2.0) * sf (0.7-7) * rgbif (1.3.0) * RColorbrewer (1.1-2) * devtools (2.1.0) * rabm (0.1.0; devtools::install_github("davidclarance/rabm")) Note that some of the exercises require that users download data. It is the responsibility of users to viruscheck all downloaded files. # Exercises Run through the exercises in order as there is some dependency from one to the next (e.g. generating certain saved objects). ## Exercise 1 - Getting started in R The program checks the course participant's R environment has the required pacakges and creates some folders for later work. It then illustrates some general data manipulation steps such as reading a csv file, accessing bits of data using indexing and subsetting, editing data, saving Rdata files, merging dataframes, loops and writing a function. The last was written interactively with the participants. …