Learn R Programming

rockchalk (version 1.8.0)

getFocal.default: Select focal values from a numeric variable

Description

getFocal.default

Usage

## S3 method for class 'default':
getFocal(x, xvals = NULL, n = 3, ...)

Arguments

x
Required. A variable
xvals
If xvals is not provided, a default divider algorithm will be selected ("quantile"). The divider algorithms provided with rockchalk are c("quantile", "std.dev.", "table", "seq"). xvals can also be the name of a user-supp
n
Number of values to be selected.
...
Other arguments that will be passed to the user-specified xvals function.

Value

  • A named vector of values.

Examples

Run this code
x <- rnorm(100)
getFocal(x)
getFocal(x, xvals = "quantile")
getFocal(x, xvals = "quantile", n = 5)
getFocal(x, xvals = "std.dev")
getFocal(x, xvals = "std.dev", n = 5)
getFocal(x, xvals = c(-1000, 0.2, 0,5))

Run the code above in your browser using DataLab