R語言基本圖形
條形圖
> install.packages("vcd")
> library(vcd)
> barplot(c(1, 2, 4, 2, 6, 4, 3, 5))
> barplot(c(1, 2, 4, 2, 6, 4, 3, 5), horiz = TRUE)
> states <- data.frame(state.region, state.x77)
> x <- aggregate(states$Illiteracy, by = list(state.region), FUN = mean)
> x
Group.1 x
1 Northeast 1.000000
2 South 1.737500
3 North Central 0.700000
4 West 1.023077
> barplot(x $ x, names.arg = x $ Group.1)
餅圖