Description Usage Arguments Value Author(s) Examples
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.
1 2 3 4 5 6 7 8 9 10 11 |
matchingvars |
data frame generated using |
criteria |
single value or vector of length equal to the number of matching variables, where values corresponds to the matching criterion for each matching variable in x. If a single value, this will be used as matching criteria for all variables. Default value is 1, corresponding to using raw data for kpoints algorithm. |
klist |
single value or vector of values of k to find solutions for. Default value is 200. |
min_area |
minimum value for change in area represented between
iterations. If the change in area represented is at or below |
n_starts |
the number of random starts (k randomly selected points). For determining the optimal number of points, a small value (e.g., 10) should be sufficient. For finding the final solution for the desired number of points, a larger number (e.g., 100) should be used. Default value is 10. |
iter |
maximum number of iterations before the |
raster_template |
one of the raster layers used for input data.
See |
verify_stop |
boolean. Indicates whether the algorithm should display figures to evaluate stopping criteria. Displays a plot of areal coverage vs iteration for each of n_starts. Default is FALSE. |
savebest |
boolean. Saves solution for kpoints as .csv file of k Subset sites. |
A list, including:
solutions
A data frame of the final solution of k
Subset cells.
Rownames correspond to the cellnumbers, and the 'x' and 'y' coordinates of
the cells are included.
solution_areas
The area (in km2) represented by the Subset cells.
totalarea
The area of the entire study area (in km2).
klist
The number of Subset cells (k
) selected by the kpoints
function.
iter
This records the value used in the kpoints
function for finding
the solution.
n_starts
This records the value used in the kpoints
function for finding
the solution.
criteria
This records the values used in the kpoints
function for finding
the solution.
min_area
This records the value used in the kpoints
function for finding
the solution.
Rachel R. Renne
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Load targetcells data for Target Cells
data(targetcells)
# Create data frame of potential matching variables for Target Cells
allvars <- makeInputdata(targetcells)
# Restrict data to matching variables of interest
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)
# Verify stopping criteria for 200 points
# Note: n_starts should be >= 10, it is 1 here to reduce run time.
results1 <- kpoints(matchingvars,criteria = criteria, klist = 200,
n_starts = 1, min_area = 50, iter = 50,
raster_template = raster_template,
verify_stop = TRUE, savebest = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.