Statistical Analysis: an Introduction using R/R/Univariate plots

From Wikibooks, open books for an open world
Jump to: navigation, search
Producing rough plots in R is extremely easy, although it can be time consuming tweaking them to get a certain look. The defaults are usually sensible.
Crystal Clear app terminal.png Input:
1 stripchart(state.areas, xlab="Area (sq. miles)") #see method="stack" & method="jitter" for others
2 boxplot(sqrt(state.area))
3 hist(sqrt(state.area))
4 hist(sqrt(state.area), 25)
5 plot(density(sqrt(state.area))
6 plot(UKDriverDeaths)
7 
8 qqnorm()
9 ecdf(
Crystal Clear app kscreensaver.png Result:


Notes[edit]