plotInteraction: Plots response surfaces for tree-based models.

Description Usage Arguments Value Author(s)

Description

Plots a response surface plot or interaction plot (2 predictors and a model response) for models of the functions ranger, randomForest, and rpart. It also plots the observed data on top of the predicted surface.

Usage

1
2
3
4
5
6
7
8
9
plotInteraction(
  model = NULL,
  data = NULL,
  x = NULL,
  y = NULL,
  z = NULL,
  grid = 100,
  point.size.range = c(0.1, 1)
  )

Arguments

model

a model object produced by the functions ranger, randomForest, or rpart.

data

dataframe used to fit the model.

x

character string, name of column in data to be plotted in the x axis.

y

character string, name of column in data to be plotted in the y axis.

z

character string, name of column in data to be plotted as a surface. Generally, the name of the response variable in model.

grid

numeric, resolution of the x and y axes.

point.size.range

numeric vector with two values defining the range size of the points representing the observed data.

Value

A ggplot object.

Author(s)

Blas M. Benito <blasbenito@gmail.com>


memoria documentation built on May 17, 2019, 9 a.m.