bngprep: Prepare data from NBN gateway or atlas for use in species...

Description Usage Arguments Value Examples

View source: R/FunctionBNGdataprep.R

Description

This function removes absence data (as the models generate their own pseudo-absences), converts British National Grid grid references into easting and northing coordinates and removes data from Northern Ireland to allow modelling using GB data layers.

Usage

1
2
3
bngprep(speciesdf, bngCol = "OSGR", precisionCol = "precision",
  datafrom = "NBNatlas", minyear = 0, maxyear = 0, mindata = 5000,
  covarRes = 300)

Arguments

speciesdf

Data frame exported from NBN gateway or NBN atlas with data for a species.

bngCol

The column name of the column in speciesdf giving the species record location as a BNG grid reference. For NBNgateway this is the 'gridReference' field. The default is set to the 'OSGR' field which is used for data from NBNatlas and is also used to generate the location precision.

precisionCol

The column name of the column in speciesdf denoting the precision of the species record locations. This only needs to be specified for NBNgateway data as this is generated from the selected bngCol for data from the NBNatlas.

datafrom

Character, one of 'NBNgateway' or 'NBNatlas', indicating the data source.'NBNatlas' is the default.The format of data from the NBN Gateway and NBN Atlas differ, which is why the 'datafrom' field must be specified when preparing the data using the bngprep function.

minyear

Numeric, the earliest year from which data should be selected. Year inclusive, data older than this will be discarded.

maxyear

Numeric, the latest year from which data should be used. Year inclusive, data newer than this will be discarded.

mindata

The target minimum number of data points to return. If this is specified, the lowest resolution data will be discarded if there are enough higher resolution data points available to reach this target.

covarRes

The resolution of the environmental covariate data layers, in metres. Data will not be discarded if it is of higher resolution than the environmental covariate layers.

Value

A copy of speciesdf with absence data removed, easting and northing columns generated from BNG grid references and data from Northern Ireland removed.

Examples

1
2
3
4
5
#Examples using data from NBN Atlas:

data(ng_data)

bngprep(speciesdf = ng_data, bngCol = 'OSGR', datafrom = 'NBNatlas', mindata = 5000, minyear = 2007, covarRes = 300)

jncc/sdms documentation built on Aug. 13, 2021, 4:21 a.m.