Interactively Demonstrate Correlation and R-squared with a Shiny App
ShinyCorExamp2.RdLaunches a Shiny app with a scatterplot of bivariate data and linked slider inputs for the correlation and R-squared, along with the number of observations and the random seed.
Details
This function requires the shiny package to be installed. It
is similar to ShinyCorExamp, but provides a slider for
R-squared as well as correlation; moving either slider updates the
other to match. New bivariate normal data are generated with the
specified correlation and plotted as a scatterplot, with the
correlation and R-squared shown in the plot title.
Value
Launches the app in non-blocking mode (via
startApp) and returns a ShinyAppHandle
immediately, so the R console remains available while the app runs
in the background. Use handle$stop() to stop the app.
Author
Greg Snow 538280@gmail.com
Examples
if(interactive()) {
h <- ShinyCorExamp2()
# h$stop() # run this when finished with the app
}