View source: R/Apply_Lookups.R
deflate | R Documentation |
Deflation using GitHub-based CSV file
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
)
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/ |
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.
Returns a data frame with the money_var deflated, using deflator_var otherwise identical to the original data frame
FullData <- read_csv("2017_SP_CompetitionVendorSizeHistoryBucketPlatformSubCustomer.csv",
col_names = TRUE, col_types = "cccccccccc",na=c("NA","NULL"))
PrepareLabelsAndColors(Coloration,FullData,"Customer")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.