build {starm} | R Documentation |
Creation of the neighbourhood's matrix.
Description
Creation of the neighbourhood's matrix.
Usage
build(data = 0, vx = 3, vy = 3, dx = 1, dy = 1, selec = FALSE,
t = 0, norm = "euclidean", returnplot = FALSE)
Arguments
data |
dataset with first column the X-coordinates of the sites and the second the Y-coodinates of the sites. |
vx |
integer, first parameter of the neighbourhood ( i.e. first parameter of ellipse if |
vy |
integer, second parameter of the neighbourhood ( i.e. second parameter of ellipse if |
dx |
positive real, distance between sites on a row. |
dy |
positive real, distance between sites on a column. |
selec |
see |
t |
double. If |
norm |
Response type : "euclidean" "inf" "abs" "lin". |
returnplot |
If |
Details
The function will return the neighborhood matrix of a dataset which must contain coodinates in the two first columns and a third column at least with the "type" of each site (it can be only "0" or "1" for example). The parameter norm
let you choose between 4 sorts of neighborhood : 3 ellipses in norm 1, 2 or infinite (resp "abs","euclidean" and "inf") with the parameters vx
and vy
which are the width and the height of the ellipse, and the norm lin
will condider only sites on the same row and column with the same parameters vx
and vy
.
Value
The neighborhood matrix
Note
If returnplot = TRUE
, variable$plot
will return an exemple of the choosen neighborhood on a center point of the dataset.
Examples
data <- plantillness
v <- which((data$NRang <= 20))
data <- data[v,]
v <- which(data$NCep <= 20)
data<-data[v,]
res <- build(data = data)
#Example with the plantillness dataset and the plot available :
res <- build(data = plantillness,returnplot = TRUE,vx = 5,vy = 5)
#Example with the plantillness dataset, only considering the sites of the type "0" :
res <- build(data = plantillness, selec = TRUE, t = c(0),vx = 5,vy = 7,norm = "inf")