knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

Rbills

Overview

Rbills helps you scrape information from PDF files. It is desined to scrape only Rocky Mountain Power and Summit Energy documents.

You can use the Rbills package to:

Theses functions are for use only with the data team and no other people.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("BYUIDSS/Rbills")

Usage

library(Rbills)

get_pdf

There are two main ways to use get_pdf function:

path <- system.file("data-raw", package = "Rbills", mustWork = TRUE)
get_pdf(path)
path <- system.file("data-raw", package = "Rbills", mustWork = TRUE)
get_pdf(path, choose.file = TRUE)

read_pdf_seg

The read_pdf_seg function only works for Summit Energy documents. This function provides a table of data that fits the template of a given file. The following code is an example.

path <- system.file("data-raw", package = "Rbills", mustWork = TRUE)

# Choose 'example_gasbill' file.
x <- get_pdf(path, choose.file = TRUE)

gas_table <- read_pdf_seg(path, x)

head(gas_table)

# If you want to convert to the csv file, use utils::write.csv function. 
# utils::write.csv(gas_table, "gas_table.csv", row.names = FALSE)

read_pdf_rmp

The read_pdf_rmp function only works for Rocky Mountain Power documents. This function provides a table of data that fits the template of a given file. The following code is an example.

path <- system.file("data-raw", package = "Rbills", mustWork = TRUE)

# Choose 'example_powerbill' file.
x <- get_pdf(path, choose.file = TRUE)

# Type Bldg 85, Main Bldg, East Bldg, West Bldg 1, West Bldg 2 when prompt function occurs.
power_table <- read_pdf_rmp(path, x)

head(power_table)

# If you want to convert to the csv file, use utils::write.csv function.
# utils::write.csv(power_table, "power_table.csv", row.names = FALSE) 


BYUIDSS/Rbills documentation built on Jan. 2, 2020, 12:47 a.m.