Learn R Programming

npsp (version 0.7-13)

mask: Mask methods

Description

Filters the data that satisfy a condition.

Usage

mask(x, ...)

# S3 method for default mask(x, tol.mask = 0, ...)

# S3 method for data.grid mask(x, mask = NULL, window = NULL, set.NA = FALSE, warn = FALSE, ...)

# S3 method for bin.den mask( x, mask = mask.default(x$binw, npsp.tolerance(2)), window = NULL, set.NA = FALSE, warn = TRUE, ... )

# S3 method for bin.data mask( x, mask = NULL, window = NULL, set.NA = FALSE, warn = FALSE, filter.lp = TRUE, ... )

# S3 method for locpol.bin mask( x, mask = mask.default(x$binw, npsp.tolerance(2)), window = NULL, set.NA = FALSE, warn = TRUE, filter.lp = TRUE, ... )

Value

mask.default returns the logical vector x > tol.mask.

mask.bin.den, mask.bin.data and mask.locpol.bin

return an object of the same class as x with the additional component $mask

and optionally $window.

Arguments

x

object used to select a method (binned data, ...).

...

further arguments passed to or from other methods

tol.mask

tolerance.

mask

logical; vector (or array) indicating the selected values (not masked).

window

spatial window (values outside this window will be masked), currently an sp-object of class extending SpatialPolygons.

set.NA

logical; If TRUE, the values corresponding to masked cells are set to NA.

warn

logical; If TRUE a warning message is generated when original data is masked.

filter.lp

logical; If TRUE, masked nodes will be leaved out in local polynomial estimation.

See Also

locpol, locpolhcv, binning, np.svar, npsp.tolerance.

Examples

Run this code
mask(1:10, 5)
bin <- binning(aquifer[,1:2], aquifer$head, nbin = c(41,41), set.NA = TRUE)
str(mask(bin, mask(bin$binw), warn = TRUE))
str(mask(bin, mask(bin$binw, 1)))

Run the code above in your browser using DataLab