FORMACIÓN AL FINAL DEL POZO
Prepara las herramientas de trabajo y abre el archivo con la información de los pozos petroleros de Brasil.
setwd("C:/Users/Usuario/Desktop/TRABAJO DE ESTADISTICA/PDF-EXCEL-QGIS")
Datos <- read.csv("Pozos brasil 2.csv", header = TRUE, sep = ";", dec = ",", fileEncoding = "Latin1")
str(Datos)
## 'data.frame': 29575 obs. of 59 variables:
## $ POCO : chr "7-RO-123HP-RJS" "1-BP-7-RJS" "7-ARGO-4H-ESS" "7-ARGO-5H-ESS" ...
## $ CADASTRO : num 7.43e+10 7.43e+10 3.43e+10 3.43e+10 3.43e+10 ...
## $ OPERADOR : chr "Petrobras" "BP Energy" "Shell Brasil" "Shell Brasil" ...
## $ POCO_OPERADOR : chr "7RO123HPRJS" "ANU" "7ARGO4HESS" "7ARGO5HESS" ...
## $ ESTADO : chr "RJ" "RJ" "ES" "ES" ...
## $ BACIA : chr "Campos" "Campos" "Campos" "Campos" ...
## $ BLOCO : chr "" "C-M-473" "" "" ...
## $ SIG_CAMPO : chr "RO " "" "ARGO " "ARGO " ...
## $ CAMPO : chr "RONCADOR" "" "ARGONAUTA" "ARGONAUTA" ...
## $ TERRA_MAR : chr "M" "M" "M" "M" ...
## $ POCO_POS_ANP : chr "S" "S" "S" "S" ...
## $ TIPO : chr "Explotatório" "Exploratório" "Explotatório" "Explotatório" ...
## $ CATEGORIA : chr "Desenvolvimento" "Pioneiro" "Desenvolvimento" "Desenvolvimento" ...
## $ RECLASSIFICACAO : chr "PRODUTOR COMERCIAL DE PETRÓLEO" "PORTADOR DE PETRÓLEO" "ABANDONADO POR OUTRAS RAZÕES" "INDEFINIDO" ...
## $ SITUACAO : chr "PRODUTOR" "ABANDONADO POR LOGÍSTICA EXPLORATÓRIA" "ABANDONADO DEFINITIVAMENTE" "PRODUTOR" ...
## $ INICIO : chr "03/03/2012" "14/03/2012" "12/04/2012" "14/04/2012" ...
## $ TERMINO : chr "10/03/2013" "20/09/2012" "19/09/2012" "02/05/2013" ...
## $ CONCLUSAO : chr "10/03/2013" "19/10/2012" "28/09/2012" "13/05/2013" ...
## $ TITULARIDADE : chr "Público" "Público" "Público" "Público" ...
## $ LATITUDE_BASE_4C : chr "-21:57:45,630" "-23:06:09,622" "-21:08:06,801" "-21:08:12,535" ...
## $ LONGITUDE_BASE_4C : chr "-39:44:01,130" "-40:00:41,295" "-39:46:53,226" "-39:46:49,296" ...
## $ LATITUDE_BASE_DD : num -22 -23.1 -21.1 -21.1 -21.1 ...
## $ LONGITUDE_BASE_DD : num -39.7 -40 -39.8 -39.8 -39.8 ...
## $ DATUM_HORIZONTAL : chr "SIRGAS2000" "SIRGAS2000" "SIRGAS2000" "SIRGAS2000" ...
## $ TIPO_DE_COORDENADA_DE_BASE: chr "Definitiva" "Definitiva" "Definitiva" "Definitiva" ...
## $ DIRECAO : chr "Horizontal" "Vertical" "Horizontal" "Horizontal" ...
## $ PROFUNDIDADE_VERTICAL_M : num -3145 6900 2937 2934 2953 ...
## $ PROFUNDIDADE_SONDADOR_M : num 4050 6925 3809 4575 4570 ...
## $ PROFUNDIDADE_MEDIDA_M : num 4050 6925 3809 4575 4570 ...
## $ REFERENCIA_DE_PROFUNDIDADE: chr "MR" "MR" "MR" "MR" ...
## $ MESA_ROTATIVA : num 24 25 24.2 24.2 24.2 ...
## $ COTA_ALTIMETRICA_M : num 0 0 0 0 0 ...
## $ LAMINA_D_AGUA_M : num 1827 2730 1706 1705 1654 ...
## $ DATUM_VERTICAL : chr "NM" "NM" "NM" "NM" ...
## $ UNIDADE_ESTRATIGRAFICA : chr "" "" "" "" ...
## $ GEOLOGIA_GRUPO_FINAL : chr "Campos" "Lagoa Feia" "Campos" "Campos" ...
## $ GEOLOGIA_FORMACAO_FINAL : chr "Carapebus" "Macabu" "Ubatuba" "Ubatuba" ...
## $ GEOLOGIA_MEMBRO_FINAL : chr "" "" "" "" ...
## $ CDPE : chr "Existe" "Existe" "Existe" "" ...
## $ AGP : chr "" "" "" "" ...
## $ PC : chr "" "Existe" "" "" ...
## $ PAG : chr "" "" "" "" ...
## $ PERFIS_CONVENCIONAIS : chr "" "Existe" "" "" ...
## $ DURANTE_PERFURACAO : chr "Existe" "Existe" "Existe" "Existe" ...
## $ PERFIS_DIGITAIS : chr "" "" "" "" ...
## $ PERFIS_PROCESSADOS : chr "" "" "" "" ...
## $ PERFIS_ESPECIAIS : chr "" "" "" "" ...
## $ AMOSTRA_LATERAL : chr "" "Existe" "" "" ...
## $ SISMICA : chr "" "Existe" "" "" ...
## $ TABELA_TEMPO_PROFUNDIDADE : chr "" "" "" "" ...
## $ DADOS_DIRECIONAIS : chr "Existe" "Existe" "Existe" "Existe" ...
## $ TESTE_A_CABO : chr "Existe" "Existe" "" "" ...
## $ TESTE_DE_FORMACAO : chr "" "" "" "" ...
## $ CANHONEIO : chr "" "" "" "" ...
## $ TESTEMUNHO : chr "" "" "" "" ...
## $ GEOQUIMICA : chr "" "" "" "" ...
## $ SIG_SONDA : chr "SS-49" "DS4" "NB2" "NB2" ...
## $ NOM_SONDA : chr "SEDCO 707" "Deep Ocean Clarion" "Bully 2" "Bully 2" ...
## $ DHA_ATUALIZACAO : chr "28/1/18 5:00" "28/1/18 5:00" "28/1/18 5:00" "28/1/18 5:00" ...
Conteo general para ver cuántas formaciones distintas existen antes de organizarlas.
GEOFF <- Datos$GEOLOGIA_FORMACAO_FINAL
TDFGEOFF <- as.data.frame(table(GEOFF))
TDFGEOFF
## GEOFF Freq
## 1 24630
## 2 Abrolhos 1
## 3 Açu 1133
## 4 Afligidos 17
## 5 Água Grande 9
## 6 Alagamar 28
## 7 Algodões 1
## 8 Aliança 71
## 9 Alto Garças 1
## 10 Aracaré 3
## 11 Ariri 26
## 12 Atafona 13
## 13 Bananeiras 19
## 14 Barra de Itiuba 90
## 15 Barra Velha 82
## 16 Barreiras 22
## 17 Barreirinha 1
## 18 Cabeças 16
## 19 Cabiúnas 14
## 20 Calumbi 53
## 21 Camboriú 36
## 22 Campo Mourão 1
## 23 Candeias 78
## 24 Carapebus 250
## 25 Carauari 2
## 26 Caravelas 4
## 27 Carbonato Salto Magessi 1
## 28 Coqueiro Seco 31
## 29 Coqueiros 31
## 30 Córrego dos Borges 3
## 31 Cotinguiba 8
## 32 Cricaré 12
## 33 Curiri 2
## 34 Embasamento 748
## 35 Emboré 22
## 36 Estância 2
## 37 Gargau 1
## 38 Goitacás 1
## 39 Guaratiba 15
## 40 Guarujá 17
## 41 Imbé 1
## 42 Imbetiba 3
## 43 Ipu 3
## 44 Itabapoana 3
## 45 Itaim 2
## 46 Itajaí-Açu 68
## 47 Itanhaém 16
## 48 Itaparica 81
## 49 Itapema 36
## 50 Jaicós 2
## 51 Jandaíra 8
## 52 Jandiatuba 4
## 53 Juréia 10
## 54 Juruá 56
## 55 Lagoa Azul 1
## 56 Lagoa Feia 79
## 57 Limoeiro 1
## 58 Longá 17
## 59 Macabu 20
## 60 Macaé 77
## 61 Macau 1
## 62 Maceió 2
## 63 Maecuru 3
## 64 Manacapuru 1
## 65 Maracangalha 62
## 66 Marambaia 45
## 67 Marfim 44
## 68 Mariricu 89
## 69 Morro do Barro 6
## 70 Mosqueiro 1
## 71 Motuca 1
## 72 Mundaú 8
## 73 Muribeca 28
## 74 Namorado 3
## 75 Nhamundá 1
## 76 Orange 1
## 77 Oriximiná 3
## 78 Outeiro 14
## 79 Paracuru 2
## 80 Pedra de Fogo 2
## 81 Pendência 238
## 82 Penedo 34
## 83 Pescada 6
## 84 Piçarras 25
## 85 Pimenteiras 15
## 86 Pojuca 22
## 87 Ponta Grossa 1
## 88 Poti 45
## 89 Puga 1
## 90 Quebradas 2
## 91 Quissamã 38
## 92 Regência 16
## 93 Retiro 22
## 94 Riachuelo 10
## 95 Rio Doce 4
## 96 Rio Pitanga 25
## 97 Salvador 2
## 98 Santos 2
## 99 São Mateus 77
## 100 São Sebastião 8
## 101 Sergi 223
## 102 Serra de Santa Helena 1
## 103 Serraria 18
## 104 Soleira 1
## 105 Sousa 1
## 106 Taciba 5
## 107 Taipus - Mirim 3
## 108 Tianguá 1
## 109 Tibau 4
## 110 Travosas 5
## 111 Ubarana 1
## 112 Ubatuba 257
## 113 Uerê 5
## 114 Urucutuca 157
Traduce los nombres técnicos, identifica los datos vacíos y agrupa
library(dplyr)
##
## Adjuntando el paquete: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(forcats)
TDF_Agrupada_F <- Datos %>%
mutate(GEOFF_Agrupado = ifelse(GEOLOGIA_FORMACAO_FINAL == "" | is.na(GEOLOGIA_FORMACAO_FINAL),
"Sin Información",
GEOLOGIA_FORMACAO_FINAL)) %>%
mutate(GEOFF_Agrupado = recode(GEOFF_Agrupado,
"Embasamento" = "Roca Base",
"Açu" = "Form. Açu",
"Pendência" = "Form. Pendencia",
"Ubatuba" = "Form. Ubatuba",
"Sergi" = "Form. Sergi",
"Urucutuca" = "Form. Urucutuca",
"Carapebus" = "Form. Carapebus",
"Barra de Itiuba" = "Barra de Itiúba",
"São Mateus" = "Form. San Mateo")) %>%
# Agrupamos en 4 principales + 1 "Otras" = 5 grupos en total
mutate(GEOFF_Agrupado = fct_lump_n(GEOFF_Agrupado, n = 4, other_level = "Otras Formaciones")) %>%
count(GEOFF_Agrupado, name = "Freq")
print(TDF_Agrupada_F)
## GEOFF_Agrupado Freq
## 1 Form. Açu 1133
## 2 Form. Ubatuba 257
## 3 Roca Base 748
## 4 Sin Información 24630
## 5 Otras Formaciones 2807
Calcula la cantidad exacta de pozos y el porcentaje que representa cada grupo sobre el total nacional.
TDF_Agrupada_F$GEOFF_Agrupado <- as.character(TDF_Agrupada_F$GEOFF_Agrupado)
TDF_Agrupada_F1<- TDF_Agrupada_F %>%
group_by(GEOFF_Agrupado) %>%
summarise(
ni = sum(Freq),
hi = round(ni / sum(TDF_Agrupada_F$Freq) * 100, 2)) %>%
arrange(desc(ni))
TDF_Agrupada_F1 <- as.data.frame(TDF_Agrupada_F1)
TDF_Agrupada_F1
## GEOFF_Agrupado ni hi
## 1 Sin Información 24630 83.28
## 2 Otras Formaciones 2807 9.49
## 3 Form. Açu 1133 3.83
## 4 Roca Base 748 2.53
## 5 Form. Ubatuba 257 0.87
Organiza las columnas finales y añade una fila de “Total” para asegurar que el análisis abarque el 100% de los datos.
colnames(TDF_Agrupada_F1)[colnames(TDF_Agrupada_F1) == "GEOFF_Agrupado"] <- "Forma_Geo_Final"
TDF_Agrupada_F1 <- TDF_Agrupada_F1[, c("Forma_Geo_Final", "ni", "hi")]
total_ni <- sum(TDF_Agrupada_F1$ni)
total_hi <- sum((TDF_Agrupada_F1$hi))
TDF_Agrupada_F1.1 <- rbind(TDF_Agrupada_F1, data.frame( Forma_Geo_Final = "Total",
ni = total_ni,
hi = total_hi))
print(TDF_Agrupada_F1.1)
## Forma_Geo_Final ni hi
## 1 Sin Información 24630 83.28
## 2 Otras Formaciones 2807 9.49
## 3 Form. Açu 1133 3.83
## 4 Roca Base 748 2.53
## 5 Form. Ubatuba 257 0.87
## 6 Total 29575 100.00
library(gt)
gt(TDF_Agrupada_F1.1) %>%
tab_header(
title = md("**Cuadro No.1**"),
subtitle = "Distibución de Formación al final del pozo de los pozos petrolíferos en Brasil") %>%
cols_align(align = "center", columns = everything()) %>%
tab_style(
style = list(cell_fill(color = "#2E4053"), cell_text(color = "white", weight = "bold")),
locations = cells_title()
) %>%
tab_style(
style = list(cell_fill(color = "#F2F3F4"), cell_text(weight = "bold", color = "#2E4053")),
locations = cells_column_labels()
) %>%
tab_options(
table.border.top.color = "#2E4053",
table.border.bottom.color = "#2E4053",
column_labels.border.bottom.color = "#2E4053",
data_row.padding = px(6))
| Cuadro No.1 | ||
| Distibución de Formación al final del pozo de los pozos petrolíferos en Brasil | ||
| Forma_Geo_Final | ni | hi |
|---|---|---|
| Sin Información | 24630 | 83.28 |
| Otras Formaciones | 2807 | 9.49 |
| Form. Açu | 1133 | 3.83 |
| Roca Base | 748 | 2.53 |
| Form. Ubatuba | 257 | 0.87 |
| Total | 29575 | 100.00 |
Datos numéricos en visualizaciones de barras y circulares para identificar tendencias a simple vista. ### Histograma de frecuencia absoluta local
TDF_Agrupada_F_g <- TDF_Agrupada_F1[TDF_Agrupada_F1$Forma_Geo_Final != "Total", ]
par(mar = c(9, 4, 4, 2))
barplot(TDF_Agrupada_F_g$ni,
main = "Gráfica N°1: Distribución de pozos petrolíferos por Formación\nal final del pozo ",
ylab = "Cantidad",
col = "#263238", names.arg = TDF_Agrupada_F_g$Forma_Geo_Final,
las = 2, cex.names = 0.8, cex.axis = 0.8, cex.main = 1)
mtext("Grupo", side = 1, line = 7)
par(mar = c(9, 4, 4, 2))
barplot(TDF_Agrupada_F_g$ni,
main = "Gráfica N°2: Distribución de pozos petrolíferos por\nFormación al final del pozo",
ylab = "Cantidad",
col = "#263238", names.arg = TDF_Agrupada_F_g$Forma_Geo_Final,
las = 2, cex.names = 0.8, cex.axis = 0.8, cex.main = 1,
ylim = c(0,30000))
mtext("Grupo", side = 1, line = 7)
par(mar = c(9, 4, 4, 2))
barplot(TDF_Agrupada_F_g$hi,
main = "Gráfica N°3: Distribución porcentual de pozos petrolíferos por\nFormación al final del pozo",
ylab = "Porcentaje",
col = "#263238", names.arg = TDF_Agrupada_F_g$Forma_Geo_Final,
las = 2, cex.names = 0.8, cex.axis = 0.8, cex.main = 1)
mtext("Grupo", side = 1, line = 7)
par(mar = c(9, 4, 4, 2))
barplot(TDF_Agrupada_F_g$hi,
main = "Gráfica N°4: Distribución porcentual de pozos petrolíferos por\nFormación al final del pozo",
ylab = "Porcentaje",
col = "#263238", names.arg = TDF_Agrupada_F_g$Forma_Geo_Final,
las = 2, cex.names = 0.8, cex.axis = 0.8, cex.main = 1,
ylim = c(0,100))
mtext("Grupo", side = 1, line = 7)
library(ggplot2)
library(ggrepel)
datos_plot <- TDF_Agrupada_F_g
datos_plot$ymax <- cumsum(datos_plot$hi)
datos_plot$ymin <- c(0, head(datos_plot$ymax, n = -1))
datos_plot$posicion_label <- (datos_plot$ymax + datos_plot$ymin) / 2
ggplot(datos_plot, aes(ymax = ymax, ymin = ymin,
xmax = 4, xmin = 1,
fill = Forma_Geo_Final)) +
geom_rect(color = "black") +
coord_polar(theta = "y") +
geom_label_repel(aes(y = posicion_label,
x = 4,
label = paste0(round(hi, 2), "%")),
size = 4,
nudge_x = 0.5,
show.legend = FALSE) +
scale_fill_brewer(palette = "Blues") +
ggtitle("Gráfica N°5: Distribución porcentual de pozos petrolíferos por\nFormación al final del pozo") +
theme_void() +
theme(
legend.position = "right",
plot.title = element_text(hjust = 0),
legend.background = element_rect(color = "black", fill = "white", linewidth = 0.5),
legend.margin = margin(10, 10, 10, 10)
)
Conclusiones <- data.frame(
Variable = "Formación al Final del Pozo",
`Rango [Min; Max]` = "N/A",
`Media (X̄)` = "N/A",
`Mediana (Me)` = "N/A",
`Moda (Mo)` = "Sin Información",
`Varianza (S²)` = "N/A",
`Desv. Est. (S)` = "N/A",
`C.V. (%)` = "N/A",
`Asimetría (As)` = "N/A",
`Curtosis (K)` = "N/A",
`Valores Atípicos` = "N/A",
check.names = FALSE
)
library(gt)
gt(Conclusiones) %>%
tab_header(
title = md("**CONCLUSIONES Y ESTADÍSTICOS**"),
subtitle = "Resumen de Indicadores de Formación al Final del Pozode los Pozos Petroleros en Brasil") %>%
tab_source_note(source_note = "Autor: Benjamin Salazar") %>%
cols_align(align = "center", columns = everything()) %>%
tab_style(
style = list(cell_fill(color = "#2E4053"), cell_text(color = "white", weight = "bold")),
locations = cells_title()
) %>%
tab_style(
style = list(cell_fill(color = "#F2F3F4"), cell_text(weight = "bold", color = "#2E4053")),
locations = cells_column_labels()
) %>%
tab_options(
table.border.top.color = "#2E4053",
table.border.bottom.color = "#2E4053",
column_labels.border.bottom.color = "#2E4053",
data_row.padding = px(6))
| CONCLUSIONES Y ESTADÍSTICOS | ||||||||||
| Resumen de Indicadores de Formación al Final del Pozode los Pozos Petroleros en Brasil | ||||||||||
| Variable | Rango [Min; Max] | Media (X̄) | Mediana (Me) | Moda (Mo) | Varianza (S²) | Desv. Est. (S) | C.V. (%) | Asimetría (As) | Curtosis (K) | Valores Atípicos |
|---|---|---|---|---|---|---|---|---|---|---|
| Formación al Final del Pozo | N/A | N/A | N/A | Sin Información | N/A | N/A | N/A | N/A | N/A | N/A |
| Autor: Benjamin Salazar | ||||||||||
El análisis de la Formación al final de los pozos muestra que la moda es la categoría “Sin Información”, lo que indica que una gran parte de los registros no cuenta con un detalle técnico de la roca final. Al agrupar los datos en 5 categorías, se observa una distribución heterogénea: mientras un grupo masivo carece de nombre, el resto de la actividad se reparte en formaciones específicas como Form. Açu o Form. Ubatuba y una gran variedad de unidades menores agrupadas en “Otras Formaciones”. Al tratarse de una variable cualitativa, el estudio se limita a las frecuencias y porcentajes, ya que no es posible calcular promedios o desviaciones.