Learn R Programming

lookupTable (version 0.1)

predict.lookupTable: Predictions from a look-up table

Description

predict method for lookupTable objects

Usage

"predict"(object, newdata, newparams = NULL, ...)

Arguments

object
a fitted lookupTable object
newdata
data.frame from which to evaluate predictions
newparams
new parameters to use in evaluating predictions
...
optional additional parameters. None are used at present.

Value

a numeric vector of predicted values

Examples

Run this code
df.input <- cars
response <- 'dist'
feature.boundaries <- list(c(-Inf, 5, 10, 15, 20, 25, Inf))
features.con <- c('speed')
dist.table <- lookupTable(df.input, response, feature.boundaries, features.con)
df.test <- data.frame(speed = c(2, 23, 41, 5, 9, 8))
predict(dist.table, df.test)

Run the code above in your browser using DataLab