focalVals function

Create a focal value vector.

Create a focal value vector.

This selects some values of a variable and creates a new "focal vector" from them. Can use one "divider" algorithm, to be selected by name.

focalVals(x, divider = "quantile", n = 3)

Arguments

  • x: The input variable may be numeric or a factor.
  • divider: Either a quoted string name of an algorithm or a function. Default = "quantile" for numeric variables, "table" for factors. Other valid values: "seq" for an evenly spaced sequence from minimum to maximum, "std.dev." for a sequence that has the mean at the center and values on either side that are proportional to the standard deviation.
  • n: Desired number of focal values.

Returns

A named vector of focal values selected from a variable. The values of the names should be informative and useful for plotting or other diagnostic work.

Details

This is a "wrapper" (or convenience) function that re-directs work to other functions. The functions that do the work to select the focal values for types ("table", "quantile", "std.dev.", "seq") are (cutByTable(), cutByQuantile(), cutBySD(), and plotSeq())

The built-in R function pretty()

works as of rockchalk 1.7.2. Any function that accepts an argument n will work, as long as it creates a vector of values.

See Also

predictOMatic newdata

Author(s)

Paul E. Johnson pauljohn@ku.edu

  • Maintainer: Paul E. Johnson
  • License: GPL (>= 3.0)
  • Last published: 2022-08-06

Useful links