
Last chance! 50% off unlimited learning
Sale ends in
AreaIdent(formula, data, subset, poly = FALSE)
formula
, such as y ~ x
specifying x and y values.
Here the formula must be entered that was used to create the scatterplot.formula
should be taken."cond"
.identify
, locator
# run the example via copy and paste
plot(temperature ~ delivery_min, data=d.pizza)
idx <- AreaIdent(temperature ~ delivery_min, data=d.pizza)
# you selected the following points
d.pizza[idx,]
points(temperature ~ delivery_min, data = d.pizza[idx,], col="green")
# use the attr("cond") for subsets in code
attr(idx, "cond")
# create a group variable for the found points
d.pizza$grp <- seq(nrow(d.pizza)) %in% idx
# try the polygon option
idx <- AreaIdent(temperature ~ delivery_min, data=d.pizza, poly=TRUE)
points(temperature ~ delivery_min, data = d.pizza[idx,], col="red")
Run the code above in your browser using DataLab