Learn R Programming

radiant.model (version 0.8.0)

plot.nb.predict: Plot method for nb.predict function

Description

Plot method for nb.predict function

Usage

# S3 method for nb.predict
plot(x, xvar = "", facet_row = ".", facet_col = ".",
  color = ".class", ...)

Arguments

x

Return value from predict function predict.nb

xvar

Variable to display along the X-axis of the plot

facet_row

Create vertically arranged subplots for each level of the selected factor variable

facet_col

Create horizontally arranged subplots for each level of the selected factor variable

color

Adds color to a scatter plot to generate a heat map. For a line plot one line is created for each group and each is assigned a different colour

...

further arguments passed to or from other methods

See Also

predict.nb to generate predictions

Examples

Run this code
# NOT RUN {
result <- nb("titanic", "survived", c("pclass","sex","age"))
pred <- predict(result, pred_cmd="pclass=levels(pclass), sex=levels(sex), age=seq(0,100,20)")
plot(pred, xvar = "age", facet_col = "sex", facet_row = "pclass")
pred <- predict(result, pred_data="titanic")
plot(pred, xvar = "age", facet_col = "sex")

# }

Run the code above in your browser using DataLab