# NOT RUN {
data(iris)
attach(iris)
iplot(Sepal.Length, Petal.Length)
d<-iplot.data()
iabline(lm(d$y ~ d$x), col = "red")
ilines(lowess(d$x,d$y), col = "#0000c0")
ilines(c(0,0),c(0,0), col = "marked", visible = FALSE)
cat("Select 'Break' from the menu of any plot to return back to R.\n")
while (!is.null(ievent.wait())) {
if (iset.sel.changed()) {
s <- iset.selected()
if (length(s) > 1)
iobj.opt(x=lowess(d$x[s],d$y[s]),visible = TRUE)
else iobj.opt(visible = FALSE)
}
}
for(i in 1:3) iobj.rm()
iplot.off()
# }
Run the code above in your browser using DataLab