Skip to content

Instantly share code, notes, and snippets.

@dominiccooney
Last active August 29, 2015 14:13
Show Gist options
  • Save dominiccooney/5a8c3edf7bf72383e296 to your computer and use it in GitHub Desktop.
Save dominiccooney/5a8c3edf7bf72383e296 to your computer and use it in GitHub Desktop.
Plotting in R

Dot diagram:

xs = c(17.8, 14.3, 15.8, 18.0, 20.2)
stripchart(xs)

Histogram:

xs = c(6.5, 2.1, 4.4, 4.7, 5.3, 2.6, 4.7, 3.0, 4.9, 4.7,
       8.6, 5.0, 4.9, 4.0, 3.4, 5.6, 4.7, 2.7, 2.4, 2.7,
       2.2, 5.2, 5.3, 4.7, 6.8, 4.1, 5.3, 7.6, 2.4, 2.1,
       4.6, 4.3, 3.0, 4.1, 6.1, 4.2)
hist(xs)

Normal probability plot:

xs = c(...)
qqnorm(xs)
qqline(xs)

Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment