neighbourhood: Constructor of the 'neighbourhood' class.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/spatialPreparation.R

Description

An object that stores the nearest k-neighbours for a set of locations.

Usage

1
neighbourhood(data, distances, index, var, coVar, prediction)

Arguments

data

A data.frame that contains the variables of interest for each local neighbourhood.

distances

A matrix with all the separating distances per local neighbourhood.

index

An index pointing from each neighbourhood to the corresponding spatial IDs.

var

The variable's name.

coVar

The covariate's name.

prediction

whether this neighbourhood is intended to be used for prediction or fitting purpose.

Value

A neighbourhood object.

Author(s)

Benedikt Graeler

See Also

neighbourhood, getNeighbours

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library("sp")
spdf <- data.frame(x=c(112,154,212,289),y=c(124,198,85,168),measure=rlnorm(4))
coordinates(spdf) <- ~x+y

neigh <- getNeighbours(spdf,size=4)
neigh

# rebuilding neigh
neighbourhood(neigh@data, neigh@distances, neigh@index, neigh@var,
              neigh@coVar, neigh@prediction)

BenGraeler/spcopula documentation built on Nov. 20, 2020, 4:07 p.m.