Learn R Programming

biogeo (version 1.0)

alternativesenv: Determine where an incorrect point record should be placed by showing alternative positions for that point based on common errors in datasets.

Description

View alternative points in an environmental space

Usage

alternativesenv(dat, g1, group1 = "Species", ev, vars, world, xname = "", yname = "", rst, locality = "", ext = c(-180, 180, -60, 90))

Arguments

dat
a dataframe containing fields with the following names: ID, x, y, Species, x_original, y_original, Correction, Modified, Exclude and the values of selected environmental variables
g1
the name of the species to select
group1
this is usually the column of species names
ev
a raster stack of environmental variables
vars
a character vector of two environmental variable names that will be used to define the environmental space. Values of these variables must be present in dat.
world
a shapefile of the world, where the column containing the country names must be "NAMES"; see data(wrld_simpl)
xname
x-axis label for the environmental space
yname
y-axis label for the environmental space
rst
a raster
locality
the name of the column of dat containing locality descriptions
ext
The extent, which can be specified as c(xmin, xmax, ymin, ymax) default extent c(-180, 180, -90, 90). Alternatively if ext="p" then the extent will be calculated from the coordinates of the points in the dataset.

Value

Details

This is an interactive plot of geographical and environmental space. Alternative positions for records selected in the geographical space are plotted in geographical space and environmental space.

See Also

alternatives, alternatives2, geo2envid, geo2envpca

Examples

Run this code
## Not run: 
# fd<-system.file(package="biogeo")
# foldenv<-file.path(fd,"inst","extdata", fsep = .Platform$file.sep)
# ev<-env2stack(foldenv, vars = "", fext="bil")
# dem<-raster(dem,xmn=-180, xmx=180, ymn=-60, ymx=90)
# plotsetup(6,6)
# g1="Species U"
# vars=c("bio1","bio12")
# d5<-alternativesenv(edat,g1,group1="Species",ev,vars,world,
# xname="Annual Mean Temperature",yname="Annual Precipitation",
# dem,locality="LocalityName",ext="p")## End(Not run)

Run the code above in your browser using DataLab