spatialSD: spatialSD

Description Usage Arguments Value See Also Examples

View source: R/spatialSD.R

Description

Computes the standard deviation of spatially referenced data using a moving window

Usage

1
spatialSD(data, xWindow, yWindow, spatialCoords, groups, na.ignore = FALSE)

Arguments

data

Dataset containing data used to calculate standard deviation and x, y coordinates.

xWindow

Number of neighbors to include in the x orientation of the moving window, including the observation the window centers on.

yWindow

Optional. Number of neighbors to include in the y orientation of the moving window, including the observation the window centers on.

spatialCoords

A vector of column name(s) containing spatial coordinates within the dataset. The x coordinates must be designated first, followed by the y coordinates. If yWindow is not provided, the y coordinates can be omitted, otherwise they will be ignored. If spatialCoords is omitted, a moving window will be used, but data will not be spatially referenced prior to calculations.

groups

Optional. Names of column(s) containing information used to subset the data into seperate groups for processing. Useful if dataset contains multiple discrete study areas.

na.ignore

Logical. If FALSE (default) NA values are assumed to be the standard deviation of non-NA values within the moving window, if TRUE NA values remain NA.

Value

A data.table of spatially calculated standard deviation values

See Also

runsd

Examples

1
2
3
4
5
6
data(vels)
#Standard deviation of velocities along ADCP transects
velSpatialSD <- spatialSD(vels, 21, spatialCoords = "tDist", groups = "transectName")
#Standard devation of velocities along ADCP transects and ensambles
data(cellVels)
velSpatialSD <- spatialSD(cellVels, 21, 5, spatialCoords = c("tDist","cellDepth"), groups = "transectName")

jasonfischer/rivSurveyR documentation built on May 18, 2019, 5:54 p.m.