# For general data science
library(tidyverse)
# For reading and writing data tables and Excel files
library(readxl)
# For data cleaning
library(janitor)
# For spatial joins
library(sf)
# For working with datetime
library(lubridate)
# For pretty tables
library(knitr)
library(gt)
knitr::opts_chunk$set(echo = TRUE)
Introduction
Oil and gas companies are required to report monthly on how much gas they’ve flared to the North Dakota Department of Mineral Resources (DMR). They use Form 5B, the Gas Production Report, which includes fields for the volumes of gas produced, used on the lease, flared, and transferred. The venting of gas is prohibited in North Dakota.
Data from the monthly reports (2003-present) is available at the DMR’s website, which has a separate data set for each month of each year. New data is made available about a month and a half after that month has ended. Select a year in the dropdown menu, and then click on the linked “Excel” text to download the file for a given month in .xlsx format. The column with volumes of flared gas is named “Flared.”
Load Data
We compiled and cleaned all this data from the state regulatory agency and saved it to new data sets available from the Howard Center here. (For more information about our data cleaning, please contact: howardcenter@asu.edu).
load(url("https://cronkitedata.s3.amazonaws.com/howard/gaslit/nd_flaring_and_venting.rda"))
Analysis
There are three claims made in the North Dakota summary that are supported by the findings from analyzing the state reported data.
FACT: Oil and gas operated flared 991,443,446,000 cubic feet of gas.
FACT: North Dakota produces more than 438 million barrels of oil in 2020, while reportedly flaring more than 991 billion cubic feet of gas, according to state records.
FACT: From 2012 to 2020, producers in North Dakota reported just under one trillion cubic feet of gas flared, according to a Howard Center analysis.
nd_annualtotals <- nd_master %>%
group_by ( year = year(report_date)) %>%
summarise ( Total = sum(flared, na.rm = TRUE))
nd_annualtotals %>%
gt(rowname_col = "year") %>%
tab_stubhead(label = "Year") %>%
tab_header(title = "Flaring Volumes Reported to North Dakota DMR",
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)
Year |
Total |
2012 |
83,765,780 |
2013 |
107,257,153 |
2014 |
130,075,509 |
2015 |
102,407,399 |
2016 |
66,023,558 |
2017 |
80,023,188 |
2018 |
135,397,352 |
2019 |
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