| wiggle {merTools} | R Documentation |
Creates a new data.frame with copies of the original observation, each assigned to a different user specified value of a variable. Allows the user to look at the effect of changing a variable on predicted values.
wiggle(data, var, values)
data |
a data frame with one or more observations to be reassigned |
var |
a character specifying the name of the variable to adjust |
values |
a vector with the variables to assign to var |
If the variable specified is a factor, then wiggle will return it as a character.
a data frame with each row in data assigned to all values for the variable chosen
data(iris) wiggle(iris[3,], "Sepal.Width", values = c(1, 2, 3, 5)) wiggle(iris[3:5,], "Sepal.Width", values = c(1, 2, 3, 5))