ESTATUS GENERAL DE LOS POZOS EN BRASIL DESDE 1937-2018

1 Carga y exploración inicial de los datos

Se cargan los datos desde un archivo CSV y se revisa su estructura general.

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" ...

2 Tabla de distribución de frecuencia del estatus

Se obtiene la frecuencia absoluta de los estatus de los pozos.

Estatus_General <- Datos$CATEGORIA
TDFEstatus <- as.data.frame(table(Estatus_General))
TDFEstatus
##        Estatus_General  Freq
## 1      Desenvolvimento 18276
## 2             Especial  1965
## 3       Estratigráfico   327
## 4             Extensão  2302
## 5              Injeção  1644
## 6 Jazida Mais Profunda   144
## 7     Jazida Mais Rasa    35
## 8             Pioneiro  4059
## 9   Pioneiro Adjacente   823

3 Reasignación de nombres de categorías

Se cambian los nombres de las categorías para mejorar la interpretación.

español <- c( 
  "Producción Comercial",
  "Otros",
  "EStudio Geológico",
  "Delimitación",
  "Inyección",
  "Búsqueda Profunda",
  "Búsqueda Superficial",
  "Exploración Inicial",
  "Exploración Vecina"
  )
levels(TDFEstatus$Estatus_General) <- español
head(TDFEstatus$Estatus_General)
## [1] Producción Comercial Otros                EStudio Geológico   
## [4] Delimitación         Inyección            Búsqueda Profunda   
## 9 Levels: Producción Comercial Otros EStudio Geológico ... Exploración Vecina

4 Cálculo de frecuencias absolutas y relativas

Se calculan las frecuencias absolutas (ni) y porcentuales (hi).

TDFEstatus$Freq <- as.numeric(as.character(TDFEstatus$Freq))
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
TDFEstatusfinal<- Datos$TDFEstatus
TDFEstatusfinal <- TDFEstatus %>%
  group_by(Estatus_General) %>%
  summarise( 
    ni = sum(Freq),
    hi = round(sum(Freq) / sum(TDFEstatus$Freq)*100, 2))
 
TDFEstatusfinal <- data.frame(TDFEstatusfinal)

5 Tabla final con totales

Se agregan los totales generales de frecuencia absoluta y relativa.

TDFEstatusfinal <- TDFEstatusfinal [, c("Estatus_General", "ni", "hi")]
total_ni <- sum(TDFEstatusfinal$ni)
total_hi <- sum(TDFEstatusfinal$hi)
TDFEstatusCompleta <- rbind(TDFEstatusfinal, data.frame(Estatus_General = "Total",
                                                ni = total_ni, 
                                                hi = total_hi))
print(TDFEstatusCompleta)
##         Estatus_General    ni     hi
## 1  Producción Comercial 18276  61.80
## 2                 Otros  1965   6.64
## 3     EStudio Geológico   327   1.11
## 4          Delimitación  2302   7.78
## 5             Inyección  1644   5.56
## 6     Búsqueda Profunda   144   0.49
## 7  Búsqueda Superficial    35   0.12
## 8   Exploración Inicial  4059  13.72
## 9    Exploración Vecina   823   2.78
## 10                Total 29575 100.00

6 Presentación tabular de resultados gt

Se presenta la tabla de frecuencias en formato visual.

library(gt)
gt(TDFEstatusCompleta) %>%
  tab_header( 
    title = md("**Cuadro No.1**"), 
    subtitle = "Estatus 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
Estatus de los pozos petrolíferos en Brasil
Estatus_General ni hi
Producción Comercial 18276 61.80
Otros 1965 6.64
EStudio Geológico 327 1.11
Delimitación 2302 7.78
Inyección 1644 5.56
Búsqueda Profunda 144 0.49
Búsqueda Superficial 35 0.12
Exploración Inicial 4059 13.72
Exploración Vecina 823 2.78
Total 29575 100.00

7 Gráficas

7.1 Histograma de frecuencia absoluta local

Se muestra la cantidad de pozos según su estatus.

TDFEstatusCompleta<- TDFEstatusCompleta[TDFEstatusCompleta$Estatus_General != "Total", ]
par(mar = c(9, 4, 4, 2))
barplot(TDFEstatusCompleta$ni,
        main = "Gráfica N°1: Distribución en cantidad del estatus general de los pozos petrolíferos en Brasil ",
        ylab = "Cantidad",
        col = "darkseagreen1", names.arg = TDFEstatusCompleta$Estatus_General,
        las = 2, cex.names = 0.7, cex.axis = 0.8, cex.main = 1)
mtext(" ESTATUS GENERAL", side = 1, line = 6.3, adj = 0.4, cex = 1)

7.2 Histograma de frecuencia absoluta global (ni)

Representa la distribución total de pozos por estatus.

par(mar = c(9, 4, 4, 2))
barplot(TDFEstatusCompleta$ni,
        main = "Gráfica N°2: Distribución en cantidad del estatus general ",
        ylab = "Cantidad",
        col = "darkseagreen1", names.arg = TDFEstatusCompleta$Estatus_General,
        las = 2, cex.names = 0.7, cex.axis = 0.8, cex.main = 1,
        ylim = c(0,30000)) 
mtext("ESTATUS GENERAL", side = 1, line = 6.3, adj = 0.4, cex = 1)

7.3 Histograma de frecuencia relativa local (hi)

Muestra el porcentaje de pozos por estatus.

par(mar = c(9, 4, 4, 2))
barplot(TDFEstatusCompleta$hi,
        main = "Gráfica N°3: Distribución en porcentaje del estatus general de los pozos petrolíferos ",
        ylab = "Porcentaje",
        col = "darkseagreen1", names.arg = TDFEstatusCompleta$Estatus_General,
        las = 2, cex.names = 0.7, cex.axis = 0.8, cex.main = 1)
mtext("ESTATUS GENERAL", side = 1, line = 6.3, adj = 0.4, cex = 1)

7.4 Histograma de frecuencia relativa global (hi)

Presenta el porcentaje global de cada estatus.

par(mar = c(9, 4, 4, 2))
barplot(TDFEstatusCompleta$hi,
        main = "Gráfica N°4: Distribución en porcentaje del estatus general de los pozos petrolíferos ",
        ylab = "Porcentaje",
        col = "darkseagreen1", names.arg = TDFEstatusCompleta$Estatus_General,
        las = 2, cex.names = 0.7, cex.axis = 0.8, cex.main = 1,
        ylim = c(0,100))
mtext("ESTATUS GENERAL", side = 1, line = 6.3, adj = 0.4, cex = 1)

7.5 Diagrama circular

Visualización de la distribución porcentual del estatus de los pozos.

library(ggplot2)
library(ggrepel)
datos_circ <- TDFEstatusCompleta
datos_circ$ymax <- cumsum(datos_circ$hi)
datos_circ$ymin <- c(0, head(datos_circ$ymax, n=-1))
datos_circ$posicion_label <- (datos_circ$ymax + datos_circ$ymin) / 2
colores <- c("#FFBF80", "#FF8000", "#FFFF33", "#B2FF8C", "#33FF00", "#A6EDFF", "#1AB2FF", "#664CFF", "#E61A33")
ggplot(datos_circ, aes(ymax=ymax, ymin=ymin, xmax=4, xmin=0, fill=Estatus_General)) +
  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_manual(values = colores) +
  ggtitle("Gráfica N°5: Distribución en porcentaje del estatus general de los pozos") +
  theme_void()+
  theme(
    legend.position = "right",
    plot.title = element_text(hjust = 0.5, margin = margin(l = 40)),
    legend.background = element_rect(color = "black", 
                                     fill = "white",    
                                     linewidth = 0.5, 
                                     linetype = "solid"
    ), 
    legend.margin = margin(t = 10, r = 10, b = 10, l = 10) 
  )