Learn R Programming

raptr (version 0.0.3)

make.DemandPoints: Generate demand points for RAP

Description

This function generates demand points for RAP using kernels.

Usage

make.DemandPoints(points, n = 100L, quantile = 0.5,
  kernel.method = c("ks", "hypervolume")[1], ...)

Arguments

points

SpatialPointsDataFrame or SpatialPoints with species presence records.

n

integer number of demand points to use for each attribute space for each species. Defaults to 100L.

quantile

numeric quantile to generate demand points within. If 0 then demand points are generated across the full range of values the points intersect. Defaults to 0.5.

kernel.method

character name of kernel method to use to generate demand points. Defaults to 'ks'.

...

arguments passed to kernel density estimating functions

Value

DemandPoints object.

Details

The values of the species records in the rasters is extracted. A kernel is fit to the points in the attribute space. Volumes are then fit to the points in the attribute space(s). Points are randomly generated inside the volume. Demand points are generated as random points inside the volume. A kernel is fit to the species records and used to predict the density at each of the demand points. By using 'ks' as an argument in kernel.method, the volume is fit as a minimum convex polygon using mcp and kde is used to fit the kernel. Note this can only be used when the data is low-dimensional (d<3). By using 'hypervolume' as an argument, the hypervolume function is used. This can be used for hyper-dimensional data.

See Also

hypervolume, kde, mcp.

Examples

Run this code
# NOT RUN {
data(cs_spp, cs_space)
# generate species points
species.points <- randomPoints(cs_spp[[1]], n=100, prob=TRUE)
env.points <- extract(cs_space, species.points)
# generate demand points for a 1d space using ks
dps1 <- make.DemandPoints(
points=env.points[,1],
kernel.method='ks'
)
# generate demand points for a 2d space using hypervolume
dps2 <- make.DemandPoints(
points=env.points,
kernel.method='hypervolume'
)
# }

Run the code above in your browser using DataLab