done through category statistics

This commit is contained in:
Dan Buch 2011-07-11 05:35:43 -04:00
parent 4ebd4f9222
commit 9cb9c68c87
2 changed files with 24 additions and 0 deletions

Binary file not shown.

View File

@ -55,3 +55,27 @@ nrow(school.freq)
colors colors
barplot(composition.freq, col=colors) barplot(composition.freq, col=colors)
q() q()
library(MASS)
school = painters$school
school
school = painters$School
school
school.freq = table(school)
pip(school.freq)
pie(school.freq)
colors = c("red", "yellow", "green", "violet", "orange", "blue", "pink", "cyan")
pie(school.freq, col=colors)
composition = painters$Composition
composition.freq = table(composition)
pip(composition.freq, col=colors)
pie(composition.freq, col=colors)
library(MASS)
school = painters$School
c_school = school == "C"
c_painters = painters[c_school,]
mean(c_painters$Composition)
pie(tapply(painters$Composition, painters$School, mean)
pie(tapply(painters$Composition, painters$School, mean))
barchart(tapply(painters$Composition, painters$School, mean))
barplot(tapply(painters$Composition, painters$School, mean))
q()