--- title: "Õunte andmed" output: html_document --- ```{r} ounad=read.table("http://www.tlu.ee/~jaagup/andmed/muu/ounad/ounad100.txt", header=TRUE, sep=",") head(ounad) table(ounad$ounasort) pie(table(ounad$ounasort)) barplot(table(ounad$ounasort)) table(ounad$ounasort, ounad$diameeter<5) barplot(table(ounad$diameeter>5, ounad$ounasort)) barplot(table(ounad$diameeter>5, ounad$ounasort), legend.text=c("alla 5", "üle 5")) barplot(table(ounad$diameeter>5, ounad$ounasort), beside=TRUE) boxplot(ounad$diameeter) boxplot(ounad$diameeter~ounad$ounasort) hist(ounad$diameeter) hist(ounad[ounad$ounasort=="Liivi sibul", "diameeter"], col="red") hist(ounad[ounad$ounasort=="Kuldrenett", "diameeter"], add=TRUE, col="yellow") table(round(ounad$diameeter)) table(round(ounad$diameeter), ounad$ounasort) t(table(round(ounad$diameeter), ounad$ounasort)) barplot(t(table(round(ounad$diameeter), ounad$ounasort))) prop.table(t(table(round(ounad$diameeter), ounad$ounasort))) prop.table(t(table(round(ounad$diameeter), ounad$ounasort)), 2) prop.table(t(table(round(ounad$diameeter), ounad$ounasort)), 1) prop.table(table(ounad$ounasort, ounad$diameeter<5)) prop.table(table(ounad$ounasort, ounad$diameeter<5), 1) prop.table(table(ounad$ounasort, ounad$diameeter<5), 2) barplot(prop.table(table(ounad$diameeter>5, ounad$ounasort)), beside=TRUE) barplot(prop.table(table(ounad$diameeter>5, ounad$ounasort), 1), beside=TRUE) barplot(100*prop.table(table(ounad$diameeter>5, ounad$ounasort), 2), beside=TRUE, ylim=c(0, 100), ylab="protsent") ```