pat2dists {apcf}R Documentation

Convert a Pattern to Distances & Ratios

Description

Creates n_sim null models by permutation of the original pattern and calculates distances between all object of a pattern closer than max_dist and determines the fractions of the perimeter of buffers with distance dist inside the study area (needed for edge correction).

Usage

pat2dists(area, pattern, max_dist, n_sim = 199, max_tries = 1e+05,
  save_patterns = NULL, verbose = FALSE)

Arguments

area, pattern

Data source name of study area and pattern (interpretation varies by driver - for some drivers, dsn is a file name, but may also be a folder, or contain the name and access credentials of a database)

max_dist

Maximum distance measured in the pattern. Usually smaller than half the diameter of the study area.

n_sim

Number of simulated patterns (randomizations) to be generated for computing the envelope and correcting the biased emperical pcf. Determines together with n_rank in dists2pcf() the alpha level of the envelope. If alpha and n_rank are fix, n_sim can be calculated by (n_rank*2/alpha)-1 eg. (5*2/0.05)-1 = 199.

max_tries

How often shall a relocation of an object be tried while randomizing the pattern.

save_patterns

Shall the simulated patterns be saved as Shapefiles for debugging/later inspections. Might be a large number of files (4 * n_sim). Can be NULL (no export) or a character string providing a basename optionally including a valid/existing path.

verbose

Provide progress information in the console. Roman numerals (x: 10, C: 100, D: 500, M: 1000) indicate the progress of the simulation and 'e' the emperical PCF.

Details

Null models are created by randomly rotating and randomly placing all objects within the study area without overlap. They are used for correcting the biased pcf and constructing a pointwise critical envelope (cf. Nuske et al. 2009).

Measuring distances between objects and permutation of the pattern is done with GEOS and spatial data are converted to GEOS geometries by GDAL/OGR.

Value

An object of class dists.

References

Nuske, R.S., Sprauer, S. and Saborowski J. (2009) Adapting the pair-correlation function for analysing the spatial distribution of canopy gaps. Forest Ecology and Management, 259(1), 107-–116. doi: 10.1016/j.foreco.2009.09.050

See Also

dists2pcf(), plot.fv_pcf()

Examples

# it's advised against setting n_sim < 199
ds <- pat2dists(area=system.file("shapes/sim_area.shp", package="apcf"),
                pattern=system.file("shapes/sim_pat_reg.shp", package="apcf"),
                max_dist=25, n_sim=3, verbose=TRUE)


[Package apcf version 0.1.3 Index]