panel.lift <- function(x, y, ...)
{
panel.xyplot(x, y, ...)
panel.abline(0, 1, col = "black")
}
set.seed(1)
simulated <- data.frame(obs = factor(rep(letters[1:2], each = 100)),
perfect = sort(runif(200), decreasing = TRUE),
random = runif(200))
lift(obs ~ random, data = simulated)
lift(obs ~ random, data = simulated,
panel = panel.lift, type = c("p", "l"))
lift(obs ~ random + perfect, data = simulated,
panel = panel.lift, type = c("p", "l"),
auto.key = list(columns = 2))
Run the code above in your browser using DataCamp Workspace