Created
November 18, 2019 18:56
-
-
Save dholstius/64dcebdc18d39e84ebebc556851666d0 to your computer and use it in GitHub Desktop.
QA of BY2015 area source forecast
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# BY2015-area_source-forecast-chart_annual_growth.R | |
# | |
# Created 2019-11-18 by dholstius | |
# | |
library(inventory) | |
library(ggtools) | |
# | |
# Change this. (Just an example.) | |
# | |
STAFF_NAME <- "Sukarn" | |
# | |
# Change this too. | |
# | |
QA_CATEGORIES <- c( | |
"#283 Space Heating" = 283) | |
# | |
# Import staff-specific crosswalk (cat_id -> gpf_id). | |
# | |
xlsx_forecast_crosswalk_data <- | |
my_dropbox( | |
"BY2015", | |
"Work", | |
"Area Sources", | |
STAFF_NAME, | |
str_c("BY2015-area_sources-", STAFF_NAME, ".xlsx")) %>% | |
read_excel( | |
sheet = "forecast_crosswalk") | |
# | |
# Import shared forecast profiles (CY2015+). | |
# | |
xlsx_forecast_profile_data <- | |
my_dropbox( | |
"BY2015", | |
"Work", | |
"Projections", | |
"BY2015_forecast_profiles.xlsx") %>% | |
read_excel( | |
sheet = "raw") | |
# | |
# Filter the crosswalk, then join to the data. | |
# | |
chart_data <- | |
xlsx_forecast_crosswalk_data %>% | |
filter_categories( | |
QA_CATEGORIES) %>% | |
inner_join( | |
xlsx_forecast_profile_data, | |
by = "gpf_id", | |
suffix = c(".crosswalk", ".profile")) | |
# | |
# Chart the filtered-and-joined data. | |
# | |
chart_data %>% | |
chart_annual_growth_by( | |
base_year = CY(2015), | |
color = category, | |
flag_years = CY(2020, 2030, 2040), | |
title = "BY2015: Area Source Forecasts", | |
subtitle = "Derived from XLSX crosswalk and profile data.") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment