R/gdpcleanerr.R
gdpcleanerr.Rd
GDP Cleaner This function will strip spurious columns, and Null valued rows, and rename retained columns from any data set from the Open Government Canada Portal that indicates it is a "GDP at Basic Prices" data set (see Data_Sources.csv for examples).
gdpcleanerr(gdpdata)
A data frame generated from the Open Government Canada Portal, preferably imported by gdpimporterr
data.frame A cleaned and simplified data frame
data <- tibble::tribble(~REF_DATE,~GEO,~DGUID,
~`North.American.Industry.Classification.System.(NAICS)`,
~UOM, ~UOM_ID,~SCALAR_FACTOR,~SCALAR_ID,~VECTOR, ~COORDINATE,
~VALUE,~STATUS,~SYMBOL,~TERMINATED,~DECIMALS,1997L,"Canada",
"2016A000011124","Total industries", "Dollars",81L,"millions",
6L, "v41894235",1.477, 816756.1, NA,NA, NA,1L,1997L,"Canada",
"2016A000011124", "Crop and animal production",
"Dollars",81L,"millions",6L,"v41700857", 1.1,12755.9,NA,NA, NA,1L)
df1 <- gdpcleanerr(data)