---
title: "Laste andmed"
output: html_document
---
Viienda klassi lapsed
```{r}
lapsed=read.table("http://www.tlu.ee/~jaagup/andmed/muu/5klass.txt",
header=TRUE, sep=",", stringsAsFactors = FALSE)
head(lapsed)
```
Laste sugude jaotuse tuldiagramm
```{r}
barplot(table(lapsed$sugu))
plot(lapsed$pikkus, lapsed$mass,
col=ifelse(lapsed$sugu=="n", "red", "blue"))
text(lapsed$eesnimi, x=lapsed$pikkus, y=lapsed$mass-2,
cex=0.5)
```
Laste nimed joonisel
```{r}
barplot(table(lapsed$sugu))
plot(lapsed$pikkus, lapsed$mass, type="n")
text(lapsed$eesnimi, x=lapsed$pikkus, y=lapsed$mass,
cex=0.5, col=ifelse(lapsed$sugu=="n", "red", "blue"))
abline(v=mean(lapsed$pikkus), lty=2, col="gray")
#Lisage horisontaaljoon keskmise massi kohta
abline(h=mean(lapsed$mass), lty=2, col="gray")
```