-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRhistory
More file actions
19 lines (19 loc) · 1.04 KB
/
Rhistory
File metadata and controls
19 lines (19 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
datos <- readr::read_csv(file = "../../../docencia-R-datascience-2324/entregas/ENTREGA 3 BIS/datos_elecciones_brutos.csv")
datos_tidy <- datos |>
+1s
library(tidyverse)
table4a
datos
datos_tidy <- datos |> pivot_longer(cols = -(tipo_eleccion:votos_candidaturas), names_to = "partido", values_to = "votos", values_drop_na = TRUE)
datos_tidy
datos_tidy |> filter(partido == "PARTIDO POPULAR")
datos_tidy |> filter(str_detect(partido, "PARTIDO POPULAR"))
datos_tidy |> filter(str_detect(partido, "PARTIDO POPULAR")) |> select(partido, votos)
datos_tidy |> filter(str_detect(partido, "PARTIDO POPULAR")) |> select(partido, votos) arrange(desc(partido))
datos_tidy |> filter(str_detect(partido, "PARTIDO POPULAR")) |> select(partido, votos) |> arrange(desc(partido))
datos_tidy |> filter(str_detect(partido, "PARTIDO NACIONALISTA VASCO")) |> select(partido, votos) |> arrange(desc(partido))
cod_mun <- read_csv(file = "../../../docencia-R-datascience-2324/entregas/ENTREGA 3 BIS/cod_mun.csv")
cod_mun
datos_tidy |> summarise(across(where(is.numeric), mean))
22*6
25*6