Learn R Programming

TeachingDemos (version 1.2)

run.cor.examp: Interactively demonstrate correlations

Description

Make a scatterplot and a Tk slider window that allows you to interactively set the correlation and/or R^2.

Usage

run.cor.examp(n = 100, seed)
run.cor2.examp(n = 100, seed)

Arguments

n
Number of points to plot.
seed
What seed to ues.

Value

  • These functions are run for their side effect, nothing meaningful is returned.

Details

The function run.cor.examp draws a scatterplot and allows you to set the correlation using a Tk slider window. The function run.cor2.examp does the same, but has a slider for R^2 as well as the correlation, when either slider is moved the other one will update to match.

See Also

cor, slider

Examples

Run this code
run.cor.examp()
run.cor2.examp()

Run the code above in your browser using DataLab