This repository contains the R package sefraInputs that provides functions and example scripts for preparation of observer data for the CCSBT SEFRA-seabird model. The package also provides access to the biological inputs for the risk assessment, including demographic parameters and density maps for the seabird populations. Compilation of the package will create a vignette containing a working example of data preparation for the risk assessment, using artificial data. The data preparation process can then be repeated on your local machine, using your own data.
The sefraInputs package should ensure that all observer datasets used in the risk assessment model are prepared using a consistent process, using the same biological inputs. The data preparation process also generates summaries of the prepared observer dataset, to facilitate reporting.
Package access and installation
Before attempting to install the sefraInputs package, users should ensure that they have followed the instructions provided at the sefra-seabirds organisation homepage. This includes:
Installing
sefraInputspackage dependencies.Installing pandoc.
Creating a Personal Access Token (PAT) specific to the
sefra-seabirdsorganisation and required repositories.
We recommend that Users notify the repository administrators by email that they have submitted a PAT request, so that it can promptly approved. Once the Personal Access Token (PAT) has been approved by the repository administrators, it should be possible to install the sefraInputs package on your machine.
The data available via the package build are versioned. To avoid inconsistencies between the repository data and the data that may be on your local machine, we recommend that the package be installed directly from this repository. This can be done using:
remotes::install_github(repo = 'sefra-seabirds/sefraInputs', build_vignettes = TRUE, force = TRUE, dependencies = TRUE, auth_token = Sys.getenv('GITHUB_SEFRA_SEABIRDS_PAT'))
If this command is called from within an R session (rather than from the command line) then the session should have no loaded packages, and there should not be any other R sessions open, otherwise there may be issues updating the required R package dependencies.
This should install the R package sefraInputs, and build the package vignettes.
Checking the package install
To check the package has installed correctly, we recommend the following.
-
Open an
Rsession and check that the vignette has compiled using:browseVignettes(package = 'sefraInputs') -
Then check what data are available using:
data(package = 'sefraInputs')
which should return a list of the fixed data inputs.
-
Also:
sefra_data(name = NULL)
will return versioned data that are available through a call to this function, including the inputsBio data objects that contains demographic parameters, as well as seabird distribution maps. This function will access data directly from this repository, and an internet connection is therefore required (see ?sefra_data).
Package vignette demonstrating data preparation for use in the risk assessment model
The package includes a vignette that demonstrates the preparation of a synthetic observer dataset for use in the risk assessment model. The vignette can be accessed using:
and selecting the HTML link for the ‘Create SEFRA inputs’ vignette.
Issues installing the package?
If you have issues installing the package, please create a new Issue for the sefraInputs Github repository with a description of the problem and any error messages, and the project team will assist.