Dirección de los Pozos Petroleros

1 Carga de Datos

Se importa la base y se verifica su estructura interna.

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          : chr  "-21,962675" "-23,1026727777" "-21,1352225" "-21,1368152777" ...
##  $ LONGITUDE_BASE_DD         : chr  "-39,7336472222" "-40,0114708333" "-39,7814516666" "-39,78036" ...
##  $ 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   : chr  "-3145,4" "6900" "2936,99" "2934,18" ...
##  $ PROFUNDIDADE_SONDADOR_M   : chr  "4050" "6925" "3809" "4575" ...
##  $ PROFUNDIDADE_MEDIDA_M     : chr  "4050" "6925" "3809" "4575" ...
##  $ REFERENCIA_DE_PROFUNDIDADE: chr  "MR" "MR" "MR" "MR" ...
##  $ MESA_ROTATIVA             : chr  "24" "25" "24,24" "24,24" ...
##  $ COTA_ALTIMETRICA_M        : chr  "0" "0" "0" "0" ...
##  $ LAMINA_D_AGUA_M           : chr  "1827" "2730" "1705,84" "1705,35" ...
##  $ 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

Se construye la tabla inicial con el conteo de cada categoría.

Direccion <- Datos$DIRECAO
TDFDireccion <- as.data.frame(table(Direccion))
TDFDireccion
##    Direccion  Freq
## 1 Direcional  5560
## 2 Horizontal  1232
## 3   Vertical 22783

3 Cálculo de frecuencias absoluta y relativa

Se obtienen las frecuencas ni y porcentajes hi por categoria.

TDFDireccion$Freq <- as.numeric(as.character(TDFDireccion$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
TDFDireccion1 <- Datos$TDFDireccion
TDFDireccion1  <- TDFDireccion %>%
  group_by(Direccion) %>%
  
  summarise( 
    ni = sum(Freq),
    hi = round(sum(Freq) / sum(TDFDireccion$Freq)*100, 5))

TDFDireccion1 <- data.frame(TDFDireccion1)

4 Incorporación de totales

Se añaden los totales generales de frecuencia absoluta y relativa.

TDFDireccion1 <- TDFDireccion1 [, c("Direccion", "ni", "hi")]
total_ni <- sum(TDFDireccion1$ni) 
total_hi <- sum(TDFDireccion1$hi)
TDFDireccion1.1 <- rbind(TDFDireccion1, data.frame( Direccion = "Total",
                                                          ni = total_ni,
                                                          hi = total_hi))
print(TDFDireccion1.1 )
##    Direccion    ni        hi
## 1 Direcional  5560  18.79966
## 2 Horizontal  1232   4.16568
## 3   Vertical 22783  77.03466
## 4      Total 29575 100.00000

5 Presentación tabular de resultados

Se formatea la tabla final para su presentación en formato gt.

library(gt)
gt(TDFDireccion1.1 ) %>%
  tab_header( 
    title = md("**DISTRIBUCIÓN DE FRECUENCIAS DE POZOS PETROLEROS DE BRASIL**"), 
    subtitle = "Dirección de los pozos petroleros") %>% 
     fmt_number(
    columns = hi,
    decimals = 2) %>%
 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))
DISTRIBUCIÓN DE FRECUENCIAS DE POZOS PETROLEROS DE BRASIL
Dirección de los pozos petroleros
Direccion ni hi
Direcional 5560 18.80
Horizontal 1232 4.17
Vertical 22783 77.03
Total 29575 100.00

6 Gráficas

6.1 Histograma de frecuencia absoluta local

Se grafica la cantidad observada por categoría sin considerar el total.

TDFDireccion2 <- TDFDireccion1.1[TDFDireccion1.1$Direccion!= "Total", ]

barplot(TDFDireccion2$ni,
        main = "Grafica N.1: Distribucion en cantidad segun la direccion de los pozos",
        xlab = "Direccion", ylab = "Cantidad",
        col = "#263238", names.arg = TDFDireccion2$Direccion,
        las = 1, cex.names = 1, cex.axis = 0.8, cex.main = 1)

6.2 Histograma de frecuencia absoluta global

Se representa la cantidad por categoría con un rango ampliado del eje vertical.

barplot(TDFDireccion2$ni,
        main = "Grfica N.2: Distribucion en cantidad segun la direccion de los pozos",
        xlab = "Direccion", ylab = "Cantidad",
        col = "#263238", names.arg = TDFDireccion2$Direccion,
        las = 1, cex.names = 1, cex.axis = 0.8, cex.main = 1,
        ylim = c(0,30000))

6.3 Histograma de frecuencia relativa local

Se visualizan los porcentajes correspondientes a cada categoría.

TDFDireccion2 <- TDFDireccion1.1[TDFDireccion1.1$Direccion!= "Total", ]

barplot(TDFDireccion2$hi,
        main = "Grafica N.3: Distribucion en cantidad segun la direccion de los pozos",
        xlab = "Direccion", ylab = "Porcentaje",
        col = "#263238", names.arg = TDFDireccion2$Direccion,
        las = 1, cex.names = 1, cex.axis = 0.8, cex.main = 1)

6.4 Histograma de frecuencia relativa global

Se muestran los porcentajes con una escala vertical extendida.

barplot(TDFDireccion2$ni,
        main = "Grfica N.4: Distribucion en cantidad segun la direccion de los pozos",
        xlab = "Direccion", ylab = "Porcentaje",
        col = "#263238", names.arg = TDFDireccion2$Direccion,
        las = 1, cex.names = 1, cex.axis = 0.8, cex.main = 1,
        ylim = c(0,30000))

6.5 Diagrama circular

Se representa la distribución porcentual de la variable mediante un gráfico circular.

pie(TDFDireccion2$hi, 
    main = "Grafica N.5: Distribucion porcentual segun la direccion de los pozos", 
    radius = 0.9,
    labels = paste0(round(TDFDireccion2$hi,2)),
    col = c("#2E4053", "#F2F3F4", "#D9E0E6"),
    cex = 1, cex.main = 1,
    init.angle = 90)

legend(x = -1.95, y =1,
       legend = TDFDireccion2$Direccion,
       fill = c("#2E4053", "#F2F3F4", "#D9E0E6"),
       cex = 1,
       title = "Dirección")

7 Resumen Estadístico

Se resume la información descriptiva esencial de la variable.

Conclusiones <- data.frame(
Variable = "Direccion",
`Rango [Min; Max]` = "N/A",
`Media (X̄)` = "N/A",
`Mediana (Me)` = "N/A",
`Moda (Mo)` = "Vertical",
`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 la Direccion de los Pozos Petroleros en Brasil") %>%
tab_source_note(source_note = "Autor: Anahi Macias") %>%
  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 la Direccion de 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
Direccion N/A N/A N/A Vertical N/A N/A N/A N/A N/A N/A
Autor: Anahi Macias

7.1 Conclusiones

Se interpretan los principales patrones observados en la distribución. #### Análisis Descriptivo

La dirección Vertical es la moda de la variable, al registrar la mayor frecuencia absoluta y relativa. Esto evidencia que la mayoría de los pozos petroleros presentan una configuración vertical, mientras que las direcciones direccional y horizontal tienen una participación menor en el conjunto de datos.