Skip to content

Commit b3e399f

Browse files
committed
Fin del tema 8
1 parent 3afc93a commit b3e399f

4 files changed

Lines changed: 624 additions & 0 deletions

File tree

scripts/tema8/02-summary.Rmd

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: "Summary"
3+
author: "Curso de Estadística Descriptiva"
4+
date: "26/12/2018"
5+
output: html_document
6+
---
7+
## Summary
8+
9+
```{r}
10+
by(iris[,c(1,3)], iris$Species, FUN = summary)
11+
```
12+
13+
14+
```{r}
15+
aggregate(cbind(Sepal.Length,Petal.Length)~Species,
16+
data=iris, FUN=summary)
17+
```
18+
19+
```{r}
20+
x = c(1,2,3,NA)
21+
sum(x)
22+
sum(x, na.rm = TRUE)
23+
mean(x)
24+
mean(x, na.rm = TRUE)
25+
var(x)
26+
var(x, na.rm = TRUE)
27+
sd(x)
28+
sd(x, na.rm = TRUE)
29+
```
30+

scripts/tema8/02-summary.html

Lines changed: 289 additions & 0 deletions
Large diffs are not rendered by default.

scripts/tema8/03-insects.Rmd

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
title: "Insecticida"
3+
author: "Curso de Estadística Descriptiva"
4+
date: "26/12/2018"
5+
output: html_document
6+
---
7+
8+
# Análisis de spray insecticida
9+
10+
Cargamos los datos del data set de `R` llamado `InsectSprays`
11+
```{r}
12+
data = InsectSprays
13+
head(data)
14+
str(data)
15+
```
16+
17+
```{r}
18+
by(data$count, data$spray, FUN = summary)
19+
```
20+
21+
```{r}
22+
aggregate(count~spray, data = data, FUN = sd)
23+
```
24+
25+
```{r}
26+
boxplot(count~spray, data = data, col = "lightgreen",
27+
xlab = "Tipo de Spray", ylab = "Insectos muertos")
28+
```
29+

scripts/tema8/03-insects.html

Lines changed: 276 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)