ds_points: ds_points

Description Usage Arguments Value

View source: R/1a_ds_points.R

Description

Creates a vector of community assignment based on neighboring points. It is based on a topological network structure where points represent nodes and the edges are the degree of similarity between those nodes. Communities are created using fast greedy algorithm that maximizes their modularity.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ds_points(
  x,
  k = 2,
  data = -grep(names(x), pattern = "^geom"),
  similarity.measure = "euclidean",
  style = "B",
  n.neigh = 8,
  plot = TRUE,
  explain = TRUE
)

Arguments

x

point or polygon shapefile data;

k

number of communities;

data

attributes of the spatial data frame to calculate similarity or distance measure;

similarity.measure

Character or function to declare distance method transformed into similarity measure. If method is character, method must be "mahalanobis" or "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski". If method is one of "euclidean", "maximum", "manhattan", "canberra", "binary" or "minkowski", see dist for details, because this function is used to compute the distance. If method is set to "mahalanobis", the mahalanobis distance is computed between neighbor points. If method is a function, this function is used to compute the distance.

style

style can take values “W”, “B”, “C”, “U”, “minmax” and “S” (see spdep::nb2listw)

n.neigh

number of neighbors considered in the k-nearest neighbor algorithm that builds topology network

plot

should the neighborhood be plotted

explain

logical. If TRUE a machine learning (randomForest using 5 fold cross validation) model is being constructed based on the data provided for regionalization. The accuracy of this model explains how much of the regionalization can be attributed to the data and how much to the spatial distribution.

Value

vector of numbers representing regions to which each element belongs to


dabrowskia/dspace documentation built on July 3, 2020, 8:47 p.m.