Purpose
Ihaka 16 Lecture Stuff

Basic Pie Chart

> x <- round(runif(5) * 100)
> names(x) <- letters[1:5]
> par(mfrow = c(1, 2))
> pie(x, main = "Test")
> pie(x, col = rainbow(5), main = "Test")

Ihaka_L16-001.jpg

Vertical Barplot

> par(mfrow = c(1, 2))
> barplot(x, las = 1, col = "sienna", main = "Test")
> barplot(x, las = 1, col = rainbow(5), main = "Test")

Ihaka_L16-002.jpg

Horizonta Barplot

> par(mfrow = c(1, 2))
> barplot(x, las = 1, col = "sienna", main = "Test", horiz = T)
> barplot(x, las = 1, col = rainbow(5), main = "Test", horiz = T)

Ihaka_L16-003.jpg

Pareto Barplot

> par(mfrow = c(1, 2))
> barplot(sort(x, T), las = 1, col = "sienna", main = "Test", horiz = F)
> barplot(sort(x, T), las = 1, col = rainbow(5), main = "Test",
+     horiz = F)

Ihaka_L16-004.jpg

Dot Charts

> par(mfrow = c(1, 2))
> dotchart(x, las = 1, col = "sienna", main = "Test")
> dotchart(x, las = 1, col = rainbow(5), main = "Test")

Ihaka_L16-005.jpg

Barchart

> x <- matrix(data = rnorm(10), nrow = 2)
> rownames(x) <- c("ols", "mle")
> colnames(x) <- letters[1:5]
> par(mfrow = c(1, 1))
> barplot(x, las = 1, legend = rownames(x), col = c("red", "darkgreen"))
> box()

Ihaka_L16-006.jpg

Horizontal bars

> x <- matrix(data = rnorm(10), nrow = 2)
> rownames(x) <- c("ols", "mle")
> colnames(x) <- letters[1:5]
> par(mfrow = c(1, 1))
> barplot(x, beside = T, las = 1, legend = rownames(x), col = c("red",
+     "darkgreen"))
> box()

Ihaka_L16-007.jpg