Learn R Programming

biogeo (version 1.0)

elevcheck: Elevation check

Description

Compares the recorded elevation values for records with values extracted from a digital elevation model and determines whether there is a mismatch in values.

Usage

elevcheck(dat, dem, elevc = "elevation", diff = 50)

Arguments

dat
A dataframe containing the required fields, including: ID, x, y, Species, x_original, y_original, Correction, Modified, Reason and Exclude. Required fields that are missing can be added using addmainfields.
dem
A digital elevation model as a raster object.
elevc
The field containing the recorded elevation (or depth) values in meters.
diff
A threshold value for determining a mismatch between the recorded elevation and the elevation extracted from the digital elevation model. If values exceed this value then they are flagged as being mismatches.

Value

See Also

errorcheck, quickclean

Examples

Run this code
## Not run: 
# gb <- keepmainfields(gbifdat,ID='',Species='species',x='decimallongitude',y='decimallatitude',
# others=c('gbifid','elevation')) # Convert example data to biogeo format
# gb <- gb[ gb$Species=='Heterotheca villosa', ] # Keep data for only one species
# dem<-raster(dem,xmn=-180, xmx=180, ymn=-60, ymx=90)
# gba<-elevcheck(gb,dem,elevc="elevation",diff=50)
# ## End(Not run)

Run the code above in your browser using DataLab