distlag: Compute custom distance lags

Description Usage Arguments Details Value Author(s) Examples

View source: R/distlag.R

Description

The function computes the centre of a set of distance classes from a (geographical) distance matrix or a data frame containing the point coordinates. The minimum, maximum and interval distances can be customized. The function returns a vector that can be used to feed the function svariog.

Usage

1
distlag(dist, dmin = 0, distance.lag = NULL, dist.lag.max = NULL)

Arguments

dist

A data.frame with 2 columns containing the point coordinates or a distance matrix (class dist).

dmin

The minimum distance to be considered. Default is 0.

distance.lag

The distance increment between two successive centre of distance classes. A default value is computed on the basis of the function hist.

dist.lag.max

The maximum distance to be considered.

Details

distlag creates a set of bins describing the distance classes on the basis of the point spatial location and a user-defined lag interval. Spatial information is provided as a distance matrix (class dist) or a set of coordinates (data.frame). Data frame must contain 1 or 2 columns (i.e. data points in 1 or 2 dimensions). NAs are not allowed and should be removed prior to using the function.

Value

A vector of values corresponding to the centre of successive distance classes

Author(s)

Jean-Pierre Rossi <[email protected]>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(sim03)

# check sampling scheme
plot(sim03$coord[,1],sim03$coord[,2], asp=1)

# changing the distance interval
distlag(dist=sim03$coord,dmin=0, distance.lag=0.5, dist.lag.max=NULL)
distlag(dist=sim03$coord,dmin=0, distance.lag=2, dist.lag.max=NULL) 

# changing the maximum distance to be considered
x <- y <- seq(0,10, length.out=10)
coord <- expand.grid(x=x, y=y)
distlag(dist=coord,dmin=0.5, distance.lag=1, dist.lag.max=NULL)
distlag(dist=coord,dmin=0.5, distance.lag=1, dist.lag.max=10)

# using a distance matrix
m<-dist(coord)
distlag(dist=m)

ggene documentation built on May 31, 2017, 4:17 a.m.