Description Usage Arguments Value Author(s) Examples
Evaluates a function like predict
evaluates a model
1 |
fun |
A function, taking arguments as in a given row of |
data |
A data frame |
newdata |
Not presently used |
Retuns a list of the function evaluations for each row of data
Georges Monette
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function( fun, data = newdata, newdata ) {
# this is meant to evaluate a function much like predict 'evaluates' a model
inds <- seq_along( rownames(data) )
ret <- rep(NA, length(inds))
for ( i in inds ) {
ret[i] <- do.call(fun,data[i,])
}
ret
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.