Table of contents

  1. Histograms
  2. Stem and leaf
  3. Dotcharts
  4. Boxplots
  5. KDEs
  6. QQ-plots
  7. Mosaic plots

Histograms


Example



Pros and cons

Also, for this data it's probably preferable to consider log base 10 (orders of magnitude), since the raw histogram simply says that most islands are small



Stem-and-leaf plots


Example

> stem(log10(islands))

  The decimal point is at the |

  1 | 1111112222233444
  1 | 5555556666667899999
  2 | 3344
  2 | 59
  3 | 
  3 | 5678
  4 | 012

Dotcharts



Discussion


Dotplots comparing grouped data


Example

data(InsectSprays)

The gist of the code is below

attach(InsectSprays)
plot(c(.5, 6.5), range(count))
sprayTypes <- unique(spray)
for (i in 1 : length(sprayTypes)){
  y <- count[spray == sprayTypes[i]]
  n <- sum(spray == sprayTypes[i])
  points(jitter(rep(i, n), amount = .1), y)
  lines(i + c(.12, .28), rep(mean(y), 2), lwd = 3)
  lines(rep(i + .2, 2), 
        mean(y) + c(-1.96, 1.96) * sd(y) / sqrt(n)
       )
}


Boxplots



Boxplots discussion

boxplot(rt(500, 2))


Kernel density estimates


Example

Data is the waiting and eruption times in minutes between eruptions of the Old Faithful Geyser in Yellowstone National park

data(faithful)
d <- density(faithful$eruptions, bw = "sj")
plot(d)


Imaging example




QQ-plots






Mosaic plots

library(MASS)
data(caith)
caith
mosaicplot(caith, color = topo.colors(4), 
           main = "Mosiac plot")
       fair red medium dark black
blue    326  38    241  110     3
light   688 116    584  188     4
medium  343  84    909  412    26
dark     98  48    403  681    85