deflate: Deflation using GitHub-based CSV file

View source: R/Apply_Lookups.R

deflateR Documentation

Deflation using GitHub-based CSV file

Description

Deflation using GitHub-based CSV file

Usage

deflate(
  data,
  money_var = "Amount",
  fy_var = "Fiscal_Year",
  deflator_file = "Lookup_Deflators.csv",
  deflator_var = "OMB25_GDP23",
  path = "https://raw.githubusercontent.com/CSISdefense/Lookup-Tables/master/",
  directory = "economic/",
  deflator_dropped = TRUE
)

Arguments

data

A data frame

money_var

The quoted name of the dollar-value variable

fy_var

The quoted name of the fiscal year variable

deflator_file

The quoted file name of the deflators to use; must be a CSV with the column "Fiscal_Year."

deflator_var

The quoted name of the defalator variable variable, by default "deflator.2017"

path

The path or url for the deflator_file CSV. By default, checks the CSISdefense Github lookups repository at CSISdefense/csis360/Lookup-Tables/data/economic/

Details

Warning: This function should be used __in data processing only__, not in a live app. It reads an external file from GitHub, which will slow down an app substantially if done repeatedly.

Value

Returns a data frame with the money_var deflated, using deflator_var otherwise identical to the original data frame

Examples


FullData <- read_csv("2017_SP_CompetitionVendorSizeHistoryBucketPlatformSubCustomer.csv",
  col_names = TRUE, col_types = "cccccccccc",na=c("NA","NULL"))
PrepareLabelsAndColors(Coloration,FullData,"Customer")


CSISdefense/csis360 documentation built on April 25, 2024, 12:01 a.m.