# For general data science
library(tidyverse)

# For working with datetime
library(lubridate)

# For pretty tables
library(gt)

knitr::opts_chunk$set(echo = TRUE)

Introduction

The Utah Division of Oil, Gas and Mining requires oil and gas operators on producing, shut-in and temporarily abandoned wells to fill a form titled Form 11 (https://oilgas.ogm.utah.gov/pub/report_forms/frm_11_2005.pdf) with information on flared and vented gas.

Data from the monthly reports (2012-present) are available at the division’s website under its Data Research Center tab here. To download the data for our selected tiem frame, click Disposition Data (2009-2014; can open in Excel), Disposition Data (2015-2019; can open in Excel), and Disposition Data (2020-2024; can open in Excel).

Load Data

We compiled and cleaned the data from the state regulatory agency and saved it as a new dataset available from the Howard Center here. (For more information about our data cleaning, please contact: )

ut <- read.csv(url("https://cronkitedata.s3.amazonaws.com/howard/gaslit/ut_flaring_and_venting.csv"))

Analysis

FACT: “According to state data, oil and gas companies in Utah flared and vented 11,390,778,000 cubic feet of natural gas between 2012 and 2020.”

We first first for the years covered (2012-2020), then group by year to calculate annual flared and vented volumes. Using the gt package, we calculate a grand total.

ut_annualtotals <- ut %>%
  filter(year >= 2012 & year <= 2020) %>%
  group_by(year) %>%
  summarise(Total = sum(vol_vented_flared, na.rm = TRUE))


ut_annualtotals %>%
   gt(rowname_col = "year") %>%
   tab_stubhead(label = "Year") %>%
   tab_header(title = "Flaring Volumes Reported to UDOGM",
              subtitle = "Flaring volumes in Mcf (thousand cubic feet)") %>%
   fmt_number(column = "Total",
              decimals = 0) %>%
   grand_summary_rows(fns = list("Total" = "sum"),
                      columns = "Total",
                      formatter=gt::fmt_number,
                      decimals=0)
Flaring Volumes Reported to UDOGM
Flaring volumes in Mcf (thousand cubic feet)
Year Total
2012 1,660,554
2013 2,424,249
2014 2,013,742
2015 987,235
2016 597,587
2017 1,216,323
2018 951,458
2019 944,164
2020 595,466
Total 11,390,778
LS0tCnRpdGxlOiAiVXRhaCBmbGFyaW5nIGFuZCB2ZW50aW5nIHRvdGFscyIKYXV0aG9yOiAiWm9oYSBUdW5pbywgU2FyYWggSHVud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