dens_obj: A wrapper for vegdistmod::densform where a multi-taxon...

Description Usage Arguments Examples

View source: R/cracle_build.R

Description

This function takes extracted climate data (from an object generated by the vegdistmod::extraction() function) and generates probability density functions for each taxon/variable pair using both a Gaussian (normal) approximation and a Gaussian Kernel Density estimator.

Usage

1
2
dens_obj(ex, clim, manip = "condi", bw = "nrd0", kern = "optcosine",
  clip = 0, n = 1024, parallel = FALSE, nclus = 4, bg.n = 200)

Arguments

ex

An object derived from the extraction() function.

clim

A raster object (see raster::raster() and raster::stack() documentation for reading raster files into R).

manip

Character string of 'reg' for straight likelihood, 'condi' for conditional likelihood statement.

bw

A bandwidth compatible with stats::density(). Options include "nrd", "nrd0", "ucv", "bcv", etc.. Default (and recommended) value is "nrd0".

kern

Type of Kernel to smooth with. Recommend 'gaussian', 'optcosine', or 'epanechnikov'. See: stats::density for options.

clip

A character string of value "range" or "95conf" or "99conf". Should the probability functions be clipped to either the empirical range or the 95 or 99 percent confidence interval?

n

Number of equally spaced points at which the probability density is to be estimated. Defaults to 1024. A lower number increases speed but decreases resolution in the function. A higher number increases resolution at the cost of speed. Recommended values: 512, 1024, 2048, ....

parallel

TRUE or FALSE. Make use of multicore architecture.

nclus

Number of cores to allocate to this function

bg.n

If there is not a background matrix, how many background points PER OCCURRENCE record should be sampled. Default is 1000.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
#distr <- read.table('test_mat.txt', head=T, sep ="\t");
#OR:
data(distr);
data(climondbioclim);
extr.raw = extraction(data=distr, clim= climondbioclim, 
 schema='flat', factor = 4, rm.outlier=FALSE);
dens.list.raw <- dens_obj(extr.raw, clim = climondbioclim, 
 manip = 'condi', bg.n = 200, bw = 'nrd0', n = 1024);
multiplot(dens.list.raw, names(climondbioclim[[1]]));

## End(Not run)

rsh249/vegdistmod documentation built on May 28, 2019, 3:31 a.m.