Learn R Programming

CarletonStats (version 2.2)

corDemo: Correlation demonstration

Description

For a given r, create a scatterplot of two variables with that correlation.

Usage

corDemo(r = 0)

Arguments

r

a number between -1 and 1. Enter any number r, \(latex\), to exit the interactive session[

Author

Laura Chihara

Details

Demonstrate the concept of correlation by inputting a number between -1 and 1 and seeing a scatter plot of two variables with that correlation. Once you invoke this command, you can continue to enter values for r. Type any number \(latex\)) to exit.

Examples

Run this code

if (FALSE) {
corDemo()
}

Run the code above in your browser using DataLab