plotcoverage: Determine optimal number of points (k)

Description Usage Arguments Value Author(s) Examples

View source: R/kpoints.R

Description

Determine a number (k) of points that maximize the areal coverage of a study area using a set of matching variables to determine similarity among sites.

Usage

1

Arguments

x

Output from kpoints function.

Value

Plot of the proportion of the study area covered for each value of k, or if only one value of k was used, reports coverage for that solution.

Author(s)

Rachel R. Renne

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Load targetcells data for Target Cells
data(targetcells)

#Create data frame of potential matching variables for Target Cells
allvars <- makeInputdata(targetcells)

# Subset to include only matching variables
matchingvars <- allvars[,c("cellnumbers","x","y","bioclim_01","bioclim_04",
"bioclim_09","bioclim_12","bioclim_15","bioclim_18")]

# Create raster_template
raster_template <- targetcells[[1]]

# Create vector of matching criteria
criteria <- c(0.7,42,3.3,66,5.4,18.4)

# Create sequence of values for k
klist = seq(25,100, by = 25)

# Run kpoints algorithm for klist
# Note: n_starts should be >= 10, it is 1 here to reduce run time.
results3 <- kpoints(matchingvars,criteria = criteria, klist = klist,
                   n_starts = 1, min_area = 50, iter = 15,
                   raster_template = raster_template, verify_stop = FALSE)

# Find optimal number of points (k)
plotcoverage(results3)

DrylandEcology/rMultivariateMatching documentation built on Dec. 17, 2021, 5:30 p.m.