Objetivo. Ver, con datos que ustedes mismos generaron, cómo se conecta la captura de datos con la visualización de resultados. Esta es la vía R → RPubs; la vía Python → Colab está en
lab00_diagnosticoy el tablero en vivo en el aula.
Cuestionario web → Google Apps Script → Hoja de Google Sheets → ┬→ Tablero en vivo (Apps Script)
(captura) (valida y guarda) (fuente única) ├→ Looker Studio
├→ R Markdown → RPubs ← estás acá
└→ Python → Google Colab
Una sola fuente de datos, varias vías de visualización. Lo que cambia es la audiencia y la necesidad: un tablero para monitorear, un informe para comunicar, un notebook para explorar.
dg <- leer_diagnostico()
d <- dg$datos
cat("Fuente:", dg$fuente, "·", nrow(d), "respuestas\n")
## Fuente: hoja de Google Sheets (en vivo vía Apps Script) · 14 respuestas
glimpse(d)
## Rows: 14
## Columns: 43
## $ ts <dttm> 2026-11-14 08:14:12, 2026-11-14 08:14:55, 2026-11-14 08:…
## $ area <chr> "Informática / Sistemas", "Ingeniería", "Educación", "Ing…
## $ cohorte <chr> "MICD 2026", "MICD 2026", "MICD 2026", "MICD 2026", "MICD…
## $ experiencia <chr> "Menos de 1 año", "1 a 3 años", "Ninguna", "Ninguna", "Me…
## $ herramientas <chr> "Excel / Google Sheets; Python; Google Colab / Jupyter", …
## $ au_python <dbl> 4, 4, 1, 4, 5, 5, 3, 5, 3, 3, 4, 5, 3, 3
## $ au_r <dbl> 1, 2, 1, 2, 5, 2, 2, 1, 5, 1, 1, 1, 2, 3
## $ au_datos <dbl> 3, 3, 2, 3, 4, 4, 3, 4, 2, 3, 3, 3, 3, 3
## $ au_graf_py <dbl> 3, 4, 2, 3, 3, 4, 2, 2, 3, 3, 3, 3, 3, 3
## $ au_graf_r <dbl> 3, 4, 1, 3, 3, 4, 1, 2, 5, 1, 3, 3, 3, 1
## $ au_colab <dbl> 3, 4, 2, 3, 4, 5, 3, 4, 4, 4, 4, 4, 4, 3
## $ au_rstudio <dbl> 1, 4, 1, 3, 4, 2, 2, 2, 5, 1, 2, 1, 3, 1
## $ au_tablero <dbl> 3, 4, 2, 3, 4, 3, 3, 4, 4, 3, 3, 3, 4, 1
## $ au_diseno <dbl> 3, 2, 1, 3, 3, 2, 3, 4, 4, 3, 1, 3, 4, 1
## $ a_V1 <chr> "B", "B", "C", "B", "B", "B", "B", "B", "B", "B", "B", "B…
## $ a_V2 <chr> "B", "NS", "A", "A", "C", "A", "A", "A", "A", "C", "A", "…
## $ a_V3 <chr> "B", "C", "NS", "C", "B", "C", "C", "C", "C", "D", "NS", …
## $ a_V4 <chr> "C", "C", "NS", "C", "D", "NS", "C", "C", "C", "C", "C", …
## $ a_P1 <chr> "A", "A", "A", "A", "C", "A", "A", "A", "A", "A", "A", "A…
## $ a_P2 <chr> "B", "B", "NS", "B", "A", "B", "B", "B", "B", "C", "A", "…
## $ a_P3 <chr> "NS", "D", "NS", "D", "D", "NS", "NS", "D", "D", "NS", "N…
## $ a_P4 <chr> "C", "C", "A", "C", "B", "C", "C", "C", "C", "A", "C", "C…
## $ a_R1 <chr> "NS", "NS", "NS", "A", "A", "NS", "B", "NS", "A", "NS", "…
## $ a_R2 <chr> "B", "B", "NS", "B", "C", "B", "B", "NS", "B", "NS", "NS"…
## $ a_R3 <chr> "C", "NS", "NS", "C", "B", "C", "C", "C", "C", "NS", "C",…
## $ a_R4 <chr> "NS", "D", "NS", "D", "A", "NS", "NS", "NS", "D", "NS", "…
## $ ok_V1 <dbl> 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
## $ ok_V2 <dbl> 0, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1
## $ ok_V3 <dbl> 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1
## $ ok_V4 <dbl> 1, 1, 0, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1, 1
## $ ok_P1 <dbl> 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1
## $ ok_P2 <dbl> 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 1
## $ ok_P3 <dbl> 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0
## $ ok_P4 <dbl> 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1
## $ ok_R1 <dbl> 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0
## $ ok_R2 <dbl> 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1
## $ ok_R3 <dbl> 1, 0, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0
## $ ok_R4 <dbl> 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0
## $ score_viz <dbl> 2, 3, 1, 4, 1, 3, 4, 4, 4, 2, 3, 3, 4, 4
## $ score_py <dbl> 3, 4, 1, 4, 1, 3, 3, 4, 4, 1, 2, 3, 2, 3
## $ score_r <dbl> 2, 2, 0, 4, 1, 2, 2, 1, 4, 0, 1, 0, 4, 1
## $ score_total <dbl> 7, 9, 2, 12, 3, 8, 9, 9, 12, 3, 6, 6, 10, 8
## $ nivel <chr> "Intermedio", "Avanzado", "Inicial", "Avanzado", "Inicial…
Cada fila es una persona y cada columna una variable (datos
ordenados / tidy). Las columnas ok_*
valen 1 si la respuesta fue correcta; score_* suman
aciertos por área (visualización, Python, R).
tema <- c(score_viz = "Visualización (conceptos)", score_py = "Python", score_r = "R")
d %>% summarise(across(c(score_viz, score_py, score_r), ~ mean(.x, na.rm = TRUE))) %>%
pivot_longer(everything(), names_to = "area", values_to = "promedio") %>%
mutate(area = factor(tema[area], levels = rev(tema))) %>%
ggplot(aes(promedio, area, fill = area)) + geom_col(show.legend = FALSE, width = .6) +
geom_text(aes(label = sprintf("%.1f / 4", promedio)), hjust = -.15) +
scale_fill_manual(values = c("Visualización (conceptos)" = "#009E73", Python = BASE, R = ENFASIS)) +
scale_x_continuous(limits = c(0, 4.6), expand = c(0, 0)) +
labs(title = "El grupo llega más fuerte en unas áreas que en otras", x = "Promedio de aciertos (máx. 4)", y = NULL) +
theme(panel.grid.major.y = element_blank())
d %>% select(score_py, score_r) %>% pivot_longer(everything(), names_to = "lenguaje", values_to = "aciertos") %>%
mutate(lenguaje = recode(lenguaje, score_py = "Python", score_r = "R")) %>%
count(lenguaje, aciertos) %>% group_by(lenguaje) %>% mutate(p = n / sum(n)) %>% ungroup() %>%
ggplot(aes(factor(aciertos), p, fill = lenguaje)) + geom_col(position = position_dodge(.8), width = .75) +
scale_fill_manual(values = c(Python = BASE, R = ENFASIS)) + scale_y_continuous(labels = percent) +
labs(title = "Más gente se concentra en pocos aciertos en R que en Python", x = "Aciertos (de 4)", y = "% de participantes", fill = NULL)
d %>% count(nivel) %>% mutate(nivel = factor(nivel, levels = c("Inicial", "Intermedio", "Avanzado")), p = n / sum(n)) %>%
ggplot(aes("", p, fill = nivel)) + geom_col(width = .5) + coord_flip() +
geom_text(aes(label = percent(p, accuracy = 1)), position = position_stack(vjust = .5), color = "white", fontface = "bold") +
scale_fill_manual(values = c(Inicial = "#c2410c", Intermedio = BASE, Avanzado = "#1a7f4b")) +
labs(title = "Composición del grupo por nivel", x = NULL, y = NULL, fill = NULL) + theme_void() + theme(legend.position = "bottom", plot.title = element_text(face = "bold"))
etq <- c(au_python = "Programar en Python", au_r = "Programar en R", au_datos = "Manipular datos (pandas / dplyr)",
au_graf_py = "Graficar con matplotlib / seaborn / plotly", au_graf_r = "Graficar con ggplot2", au_colab = "Usar Google Colab / Jupyter",
au_rstudio = "Usar RStudio y R Markdown", au_tablero = "Construir tableros", au_diseno = "Criterios de diseño visual")
d %>% summarise(across(all_of(names(etq)), ~ mean(.x, na.rm = TRUE))) %>% pivot_longer(everything(), names_to = "id", values_to = "media") %>%
mutate(habilidad = etq[id], lenguaje = case_when(id %in% c("au_r", "au_graf_r", "au_rstudio") ~ "R", id %in% c("au_python", "au_graf_py", "au_colab") ~ "Python", TRUE ~ "General")) %>%
ggplot(aes(media, reorder(habilidad, media), fill = lenguaje)) + geom_col(width = .7) + geom_text(aes(label = sprintf("%.1f", media)), hjust = -.2, size = 3.5) +
scale_fill_manual(values = c(Python = BASE, R = ENFASIS, General = GRIS)) + scale_x_continuous(limits = c(0, 5.4), expand = c(0, 0)) +
labs(title = "Autoevaluación promedio (1 = nunca lo hice · 5 = con soltura)", x = NULL, y = NULL, fill = NULL) + theme(panel.grid.major.y = element_blank())
d %>% mutate(auto = (au_python + au_r) / 2, aciertos = score_py + score_r) %>%
ggplot(aes(auto, aciertos)) + geom_jitter(width = .12, height = .12, color = BASE, alpha = .6, size = 2) +
geom_smooth(method = "lm", se = TRUE, color = ENFASIS, fill = ENFASIS, alpha = .15) +
labs(title = "Quien se autoevalúa más alto acierta más… pero con mucha dispersión", x = "Autoevaluación media (Python y R)", y = "Aciertos en Python + R (de 8)")
d %>% summarise(across(starts_with("ok_"), ~ mean(.x, na.rm = TRUE))) %>% pivot_longer(everything(), names_to = "id", values_to = "p") %>%
mutate(id = sub("ok_", "", id), tema = recode(substr(id, 1, 1), V = "Visualización", P = "Python", R = "R")) %>%
ggplot(aes(p, reorder(id, p), fill = tema)) + geom_col(width = .7) + geom_text(aes(label = percent(p, accuracy = 1)), hjust = -.15, size = 3.5) +
scale_fill_manual(values = c("Visualización" = "#009E73", Python = BASE, R = ENFASIS)) + scale_x_continuous(labels = percent, limits = c(0, 1), expand = c(0, 0)) +
labs(title = "De la pregunta más difícil a la más fácil", x = "% de aciertos", y = NULL, fill = NULL) + theme(panel.grid.major.y = element_blank())
Con plotly + crosstalk los filtros funcionan en el navegador, incluso publicados en RPubs:
sd <- SharedData$new(d %>% mutate(auto_py = au_python, auto_r = au_r))
bscols(widths = c(3, 9),
list(filter_select("area", "Área", sd, ~ area), filter_select("exp", "Experiencia", sd, ~ experiencia)),
plot_ly(sd, x = ~ score_py, y = ~ score_r, color = ~ nivel, colors = c(Inicial = "#c2410c", Intermedio = BASE, Avanzado = "#1a7f4b"),
type = "scatter", mode = "markers", marker = list(size = 9, opacity = .6), text = ~ paste(area, "·", experiencia), hoverinfo = "text") %>%
layout(title = "Aciertos en Python (x) vs R (y)", xaxis = list(title = "Python (0–4)", dtick = 1), yaxis = list(title = "R (0–4)", dtick = 1)))