diff --git a/elementary-statistics/.RData b/elementary-statistics/.RData index cdfd547..f012f98 100644 Binary files a/elementary-statistics/.RData and b/elementary-statistics/.RData differ diff --git a/elementary-statistics/.Rhistory b/elementary-statistics/.Rhistory index 5f9350c..6efaec7 100644 --- a/elementary-statistics/.Rhistory +++ b/elementary-statistics/.Rhistory @@ -55,3 +55,27 @@ nrow(school.freq) colors barplot(composition.freq, col=colors) 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()