datos_originales <- readr::read_delim(
ruta, delim=delimitador, trim_ws=TRUE,
show_col_types=FALSE, name_repair="minimal"
)
## Carga exitosa: 47.501 registros.
simbolo_limpio <- datos_originales |>
dplyr::transmute(Simbolo=stringr::str_squish(as.character(.data[[columna_simbolo]]))) |>
dplyr::filter(!is.na(Simbolo), Simbolo != "",
!toupper(Simbolo) %in% c("NA", "N/A", "NULL"))
N <- nrow(simbolo_limpio)
if (N == 0L) stop("No hay registros válidos de MAP_SYMBOL.")
k_simbolos <- dplyr::n_distinct(simbolo_limpio$Simbolo)
cat("Registros válidos:", fmt_entero(N),
" | Símbolos del mapa distintos:", fmt_entero(k_simbolos), "\n")
## Registros válidos: 47.501 | Símbolos del mapa distintos: 13
| VARIABLE | TIPO | ESCALA DE MEDICIÓN | UNIDAD DE ANÁLISIS | CATEGORÍAS (k) | REGISTROS VÁLIDOS (N) |
|---|---|---|---|---|---|
| MAP_SYMBOL (Símbolo del mapa) | Cualitativa nominal | Nominal | Pozo regulado | 13 | 47.501 |
cat(crear_cuadro(
tabla_frecuencias, 1,
"Distribución de frecuencias de los pozos regulados según el símbolo del mapa, Nueva York, 1860 - 2026"
))
| SÍMBOLO DEL MAPA | FRECUENCIA ABSOLUTA (nᵢ) | FRECUENCIA RELATIVA (hᵢ) | FRECUENCIA RELATIVA PORCENTUAL (%) |
|---|---|---|---|
| SP | 171 | 0.0036 | 0.36% |
| OWP | 10.075 | 0.2121 | 21.21% |
| CON | 36 | 0.0008 | 0.08% |
| O | 8.165 | 0.1719 | 17.19% |
| GW | 8.737 | 0.1839 | 18.39% |
| OW | 8.007 | 0.1686 | 16.86% |
| GWP | 2.169 | 0.0457 | 4.57% |
| SMP | 625 | 0.0132 | 1.32% |
| DH | 591 | 0.0124 | 1.24% |
| OP | 5.576 | 0.1174 | 11.74% |
| DP | 2.243 | 0.0472 | 4.72% |
| SM | 144 | 0.0030 | 0.30% |
| S | 962 | 0.0203 | 2.03% |
| TOTAL | 47.501 | 1.0000 | 100.00% |
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
Interpretación: el símbolo del mapa con mayor frecuencia es OWP, con 10.075 pozos (21.21% del total); la frecuencia mínima es de 36 pozos y corresponde a CON.
ggplot2::ggplot(tabla_local, ggplot2::aes(x=Simbolo,y=ni,fill=Simbolo)) +
ggplot2::geom_col(width=.72,color="#244861",linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=fmt_entero(ni)),vjust=-.48,
size=4.5,fontface="bold",color="#15364C") +
ggplot2::scale_fill_manual(values=colores) +
escala_simbolos +
ggplot2::scale_y_continuous(limits=c(0,limite_ni_local),
labels=fmt_entero,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::labs(title="Gráfica N° 1: Frecuencia absoluta (nᵢ) local",
x="Símbolo del mapa",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=Simbolo,y=ni)) +
ggplot2::geom_col(fill="#286492",color="#244861",width=.72,linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=fmt_entero(ni)),vjust=-.48,
size=4.5,fontface="bold",color="#15364C") +
escala_simbolos +
ggplot2::scale_y_continuous(limits=c(0,limite_ni_global),
labels=fmt_entero,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::labs(title="Gráfica N° 2: Frecuencia absoluta (nᵢ) global",
x="Símbolo del mapa",y="Frecuencia absoluta (nᵢ)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_local, ggplot2::aes(x=Simbolo,y=hi,fill=Simbolo)) +
ggplot2::geom_col(width=.72,color="#244861",linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=sprintf("%.2f%%",100*hi)),vjust=-.48,
size=4.3,fontface="bold",color="#15364C") +
ggplot2::scale_fill_manual(values=colores) +
escala_simbolos +
ggplot2::scale_y_continuous(limits=c(0,limite_hi_local),labels=etiqueta_pct,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::labs(title="Gráfica N° 3: Frecuencia relativa (hᵢ) local",
x="Símbolo del mapa",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
ggplot2::ggplot(tabla_global, ggplot2::aes(x=Simbolo,y=hi)) +
ggplot2::geom_col(fill="#286492",color="#244861",width=.72,linewidth=.36) +
ggplot2::geom_text(ggplot2::aes(label=sprintf("%.2f%%",100*hi)),vjust=-.48,
size=4.3,fontface="bold",color="#15364C") +
escala_simbolos +
ggplot2::scale_y_continuous(limits=c(0,limite_hi_global),
breaks=seq(0,1,by=.2),labels=etiqueta_pct,
expand=ggplot2::expansion(mult=c(0,0))) +
ggplot2::labs(title="Gráfica N° 4: Frecuencia relativa (hᵢ) global",
x="Símbolo del mapa",y="Frecuencia relativa (%)",caption=fuente_graficas) +
tema_barras
leyenda <- paste0(stringr::str_wrap(as.character(tabla_local$Simbolo),width=23),
" — ",sprintf("%.2f%%",tabla_local$porcentaje))
ggplot2::ggplot(tabla_local,ggplot2::aes(x=1,y=ni,fill=Simbolo)) +
ggplot2::geom_col(width=1,color="#244861",linewidth=.48) +
ggplot2::coord_polar(theta="y",start=0) +
ggplot2::scale_fill_manual(values=colores,labels=leyenda) +
ggplot2::labs(title="Gráfica N° 5: Distribución porcentual según el símbolo del mapa",
fill="Símbolo del mapa — porcentaje",caption=fuente_graficas) +
ggplot2::theme_void(base_size=15) +
ggplot2::theme(
plot.title=ggplot2::element_text(hjust=.5,face="bold",size=17,color="#15364C"),
legend.position="right",
legend.title=ggplot2::element_text(face="bold",size=13,color="#15364C"),
legend.text=ggplot2::element_text(size=12,color="#253B4B",lineheight=1.05),
legend.key.size=grid::unit(.56,"cm"),
plot.caption=ggplot2::element_text(hjust=0,face="italic",size=10.5,
color="#546775",margin=ggplot2::margin(t=14)),
plot.margin=ggplot2::margin(18,30,25,24)
)
cat(crear_indicadores())
| VARIABLE ANALIZADA | Media (X̄) | Mediana (Me) | Moda (Mo) | Desviación estándar (Sd) | Coeficiente de variación (CV %) | Asimetría (As) | Curtosis (K) | Valores atípicos (Outliers) |
|---|---|---|---|---|---|---|---|---|
| MAP_SYMBOL (Símbolo del mapa) | N/A | N/A | OWP | N/A | N/A | N/A | N/A | N/A |
N/A: No aplicable a una variable cualitativa nominal.
Registros válidos (N): 47.501 | Categorías: 13 | Frecuencia modal: 10.075 | Porcentaje modal: 21.21%.
Fuente: Oil, Gas & Other Regulated Wells: Beginning 1860.
La variable MAP_SYMBOL (Símbolo del mapa) es cualitativa nominal y presenta 13 categorías en 47.501 registros válidos. La moda corresponde a OWP, con una frecuencia de 10.075 pozos (21.21% del total), lo que evidencia una concentración de los registros en determinados símbolos cartográficos utilizados para los pozos del estado de Nueva York.
Autor: Jennifer Cordones | Análisis Estadístico — Oil, Gas & Other Regulated Wells - NY State