Capítulo 8 Soluciones a problemas
Todos los problemas en programación tienen más de una forma de llegar a ellos, es por esto que las soluciones acá mostradas deben tomarse solo como una referencia, y revisar si el resultado final de tu código (aunque sea distinto de este), sea igual al que presentamos.
8.1 Capítulo 1
8.1.1 Ejercicio 1
Algunas posibles soluciones:
storms %>% filter(status == "hurricane") %>% select(year, wind,
hu_diameter) %>% group_by(year) %>% summarize_all(mean)
8.1.2 Ejercicio 2
Una de las soluciones posibles:
8.2 Capítulo 2
8.2.1 Ejercicio 1
Una posible solución a este problema sería:
`r mean((iris %>% filter(Species == "virginica"))$Petal.Length)`
8.3 Capítulo 3
8.3.1 Ejercicio 1
8.3.1.1 a
lon | lat | basisOfRecord |
---|---|---|
-72.89979 | -50.85621 | HUMAN_OBSERVATION |
-72.88027 | -49.33296 | HUMAN_OBSERVATION |
-73.00350 | -46.69153 | HUMAN_OBSERVATION |
-72.61874 | -46.76851 | HUMAN_OBSERVATION |
-72.97728 | -51.07892 | HUMAN_OBSERVATION |
-71.87139 | -45.94562 | HUMAN_OBSERVATION |
-71.86151 | -46.17067 | HUMAN_OBSERVATION |
-71.88937 | -46.04310 | HUMAN_OBSERVATION |
-72.87022 | -51.12036 | HUMAN_OBSERVATION |
-72.00898 | -46.01153 | HUMAN_OBSERVATION |
-73.14041 | -50.84305 | HUMAN_OBSERVATION |
-71.85057 | -45.99832 | HUMAN_OBSERVATION |
-72.07593 | -46.05139 | HUMAN_OBSERVATION |
-71.91163 | -45.84344 | HUMAN_OBSERVATION |
-71.91210 | -46.12133 | HUMAN_OBSERVATION |
-73.99358 | -48.54769 | HUMAN_OBSERVATION |
-71.81252 | -46.04818 | HUMAN_OBSERVATION |
-72.54534 | -46.65755 | HUMAN_OBSERVATION |
-72.97587 | -51.18353 | HUMAN_OBSERVATION |
-73.03667 | -51.04976 | HUMAN_OBSERVATION |
-72.33888 | -47.07042 | HUMAN_OBSERVATION |
-72.93940 | -49.37483 | HUMAN_OBSERVATION |
-72.75092 | -46.08747 | HUMAN_OBSERVATION |
-72.17776 | -46.88179 | HUMAN_OBSERVATION |
-72.91720 | -49.30175 | HUMAN_OBSERVATION |
-72.87917 | -49.37064 | HUMAN_OBSERVATION |
-72.97712 | -51.01511 | HUMAN_OBSERVATION |
-71.87026 | -46.08686 | HUMAN_OBSERVATION |
-72.02424 | -45.92156 | HUMAN_OBSERVATION |
-72.13481 | -46.11689 | HUMAN_OBSERVATION |
-72.89062 | -46.03708 | HUMAN_OBSERVATION |
-72.43751 | -47.20485 | HUMAN_OBSERVATION |
-72.45489 | -47.00600 | HUMAN_OBSERVATION |
-73.01456 | -51.03635 | HUMAN_OBSERVATION |
-73.03190 | -51.17531 | HUMAN_OBSERVATION |
-72.72944 | -46.25602 | HUMAN_OBSERVATION |
-71.31538 | -41.30110 | PRESERVED_SPECIMEN |
-71.31538 | -41.30110 | PRESERVED_SPECIMEN |
-71.71667 | -44.86667 | PRESERVED_SPECIMEN |
-71.71667 | -44.86667 | PRESERVED_SPECIMEN |
-71.30989 | -40.81978 | PRESERVED_SPECIMEN |
-71.31538 | -41.30110 | PRESERVED_SPECIMEN |
-73.02467 | -50.46476 | PRESERVED_SPECIMEN |
-71.33186 | -41.26523 | PRESERVED_SPECIMEN |
-73.01764 | -50.46747 | PRESERVED_SPECIMEN |
-71.00000 | -30.00000 | PRESERVED_SPECIMEN |
-71.00000 | -30.00000 | PRESERVED_SPECIMEN |
-71.70000 | -45.26667 | PRESERVED_SPECIMEN |
-71.70000 | -45.26667 | PRESERVED_SPECIMEN |
-71.70000 | -45.26667 | PRESERVED_SPECIMEN |
-72.08000 | -47.25000 | PRESERVED_SPECIMEN |
-71.36714 | -41.13574 | PRESERVED_SPECIMEN |
-71.71094 | -42.75692 | HUMAN_OBSERVATION |
-70.91129 | -53.15483 | PRESERVED_SPECIMEN |
-73.84761 | -42.54746 | PRESERVED_SPECIMEN |
-71.00000 | -30.00000 | PRESERVED_SPECIMEN |
-71.00000 | -30.00000 | PRESERVED_SPECIMEN |
-71.64718 | -40.22605 | PRESERVED_SPECIMEN |
-67.88534 | -43.99376 | PRESERVED_SPECIMEN |
8.3.1.2 b
## `summarise()` ungrouping output (override with `.groups` argument)
basisOfRecord | N |
---|---|
HUMAN_OBSERVATION | 132 |
PRESERVED_SPECIMEN | 70 |