Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

focalVals

Create a focal value vector.


Description

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.

Usage

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.

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.

Value

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.

Author(s)

Paul E. Johnson <pauljohn@ku.edu>

See Also

predictOMatic newdata


rockchalk

Regression Estimation and Presentation

v1.8.144
GPL (>= 3.0)
Authors
Paul E. Johnson [aut, cre], Gabor Grothendieck [ctb]
Initial release
2019-03-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.