View source: R/1.1.f.data.prep.R
split_poly | R Documentation |
Cluster points and create several small polygons. Implemented methods are 'Hierarchical Clustering' (when 'k' number of clusters is defined 'k > 0'), 'Elbow' (c.m = "E"), 'Affinity Propagation' (c.m = AP), and several methods implemented in function NbClust of NbClust package (c.m = "NB"). To use NbClust package, check arguments 'distance', 'min.nc', 'max.nc', 'method', and 'index' in ?NbClust::NbClust.
split_poly(
occ.spdf,
k = NULL,
nm.col.dt = NULL,
c.m = "NB",
r = 2,
q = 0.3,
distance = "euclidean",
min.nc = 1,
max.nc = 20,
method = "centroid",
index = "trcovw",
alphaBeale = 0.1,
convex = TRUE,
alpha = 10,
sp.nm = "species",
save = T,
crs.set = "+proj=longlat +datum=WGS84"
)
occ.spdf |
An object of class SpatialPoints or SpatialPointsDataFrame (e.g. species occurence coordinates) |
k |
number of polygons to create based on coordinates |
nm.col.dt |
"character". Name of a numeric column to use as grouping variable in addition to coordinates. |
c.m |
clustering method to find the best number of clusters (k). Currently E (Elbow) or (Affinity Propagation). |
r |
exponent (see details below) |
q |
if |
distance |
the distance measure to be used to compute the dissimilarity matrix. This must be one of: "euclidean", "maximum", "manhattan", "canberra", "binary", "minkowski" or "NULL". By default, distance="euclidean". If the distance is "NULL", the dissimilarity matrix (diss) should be given by the user. If distance is not "NULL", the dissimilarity matrix should be "NULL". |
min.nc |
minimal number of clusters, between 1 and (number of objects - 1) |
max.nc |
maximal number of clusters, between 2 and (number of objects - 1), greater or equal to min.nc. By default, max.nc=15. |
method |
type of distance measure to be used; for |
index |
the index to be calculated. This should be one of : "kl", "ch", "hartigan", "ccc", "scott", "marriot", "trcovw", "tracew", "friedman", "rubin", "cindex", "db", "silhouette", "duda", "pseudot2", "beale", "ratkowsky", "ball", "ptbiserial", "gap", "frey", "mcclain", "gamma", "gplus", "tau", "dunn", "hubert", "sdindex", "dindex", "sdbw", "all" (all indices except GAP, Gamma, Gplus and Tau), "alllong" (all indices with Gap, Gamma, Gplus and Tau included). |
alphaBeale |
significance value for Beale's index. |
convex |
Logical. Convex (T) or concave (F) polygon |
alpha |
Value of |
sp.nm |
Species name, used on saving shapefile |
save |
Should save polygons on disk? |
crs.set |
set the coordinate reference system (CRS) of the polygons |
spatial polygons built using coordinates
set_calibarea
, set_calibarea_b
, NbClust
## Not run:
Bvarieg.occ <- read.table(paste(system.file(package="dismo"),
"/ex/bradypus.csv", sep=""), header=TRUE, sep=",")
colnames(Bvarieg.occ) <- c("SPEC", "LONG", "LAT")
spp.occ.list <- list(Bvarieg = Bvarieg.occ)
occ.polys <- set_calibarea_b(spp.occ.list)
occ.polys$Bvarieg <- split_poly(occ.spdf = spp.occ.list$Bvarieg, k=5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.