makepredictcall
Utility Function for Safe Prediction

Description

A generic function used by model.frame to replace calls to functions whose default values depend on the first argument with calls to the same functions with the default values specified explicitly.

Usage

makepredictcall(var, call)

Arguments

var an object created by evaluating the call argument, typically a vector or matrix with added attributes. It is expected that the attributes will contain information about the values of arguments to the function called by the call that were not specified in the call. E.g., the attributes of scale(x, center=TRUE) will contain the implied numeric values of the for the center and scale arguments.
call the call object from which var was derived (via eval).

Details

makepredictcall is a generic function and package writers are welcome to write methods for it when they write functions whose default auxillary argument values depend on the main argument. It dispatches on the class of the object generated by the function in question and can use language object analysis functions like formals and match.call on the call to see what actual arguments were used.
The stats package contains a default method which returns the call, unaltered, a matrix method which deals with calls to scale, and a poly method for the poly function.
Value
a call, most of time it is the same as argument call but for special functions it will have extra or altered arguments so that calling it with a new value for the main argument will use the same auxillary argument values as the origanal call.
See Also
attributes, match.call, formals.
Examples
x <- 1:10
makepredictcall(scale(x, center=TRUE), quote(scale(x, center=TRUE)))
# scale(x = x, center = 5.5, scale = 3.02765035409749)
Package stats version 6.0.0-69
Package Index