View source: R/logit_interactive.R
interactive_logit | R Documentation |
Interactive visualization function that lets you point-and-click to add data points, while it automatically plots and updates a logistic regression curve and associated statistics.
interactive_regression(points, ...) *Click on the plotting area to add points and see a corresponding regression curve (hitting ESC will stop the simulation).*
points |
An optional |
formula |
A |
... |
Further arguments passed to the |
A dataframe
containing the points coordinates.
plot_regr
# Selecting coordinates on the plot area, storing them in 'pts' pts <- interactive_logit() # Replotting the points stored earlier in 'pts', allowing the user to # continue the interactive regression interactive_logit(pts) # Providing coordinates beforehand mydata <- data.frame(in = c(1, 4, 7, 10), out = c(0, 0, 1, 1)) interactive_regression(mydata, formula = out ~ in)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.