Using the electrical bill function

Rocky Mountain Power commercial electrical bills include a list of buildings on the first page. Notice the list in the image shown below. This is the first page of the example_powerbill.pdf included with the package. See that the named buildings are just below the address and that they have a meter number associated on the same line.

By providing the text name of the building we can then process the data from the multi-page pdf and find the energy usage from that monthly building. Let’s pull the data for the following buildings.

  • East Bldg
  • Main Bldg
  • Bldg 85
  • West Bldg 1
  • West Bldg 2
path <- system.file("data-raw", package = "Rbills", mustWork = TRUE)

# Choose 'example_powerbill' file.
x <- list.files(path, "powerbill")

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

Then you can see the table of data

knitr::kable(power_table)
invoice_date building meter_number onkwh offkwh totalkwh kvarh
2016-08-13 Bldg 85 28909005 NA NA 145440 65680
2016-08-13 Main Bldg 28456882 111900 251400 363300 171900
2016-08-13 East Bldg 46528145 162600 487500 650100 291600
2016-08-13 West Bldg 1 64022800 NA NA 198900 33000
2016-08-13 West Bldg 2 50422516 NA NA 441300 151500