dfo-mar-odis / TBSpayRates

An R package to extract rates of pay for public servants from the Treasury Board of Canada Secretariat and tools for project planning/salary forecasting.
https://dfo-mar-odis.github.io/TBSpayRates/
Other
0 stars 0 forks source link

Figure out how to deal with the following: CO – DEV/PER #10

Closed j-harbin closed 5 months ago

j-harbin commented 5 months ago

This is for group = AV

j-harbin commented 5 months ago

Make sure that sal$Classification is in the format (AV-01) (e.g. the 01)

test <- unlist(lapply(strsplit(salary$Classification, "-"), function(x) trimws(x[2], "left")))

#

HERE JAIM

if(!(any(grepl("^0", test)))) {

k <- which(!(grepl("^0", test)))

#

if (!(is.na(suppressWarnings(tryCatch(as.numeric(test[k]), error = function(e) NA))))) {

salary$Classification[k] <- paste0(trimws(unlist(lapply(strsplit(salary$Classification[k], "-"), function(x) x[1])), "right"), "-0",trimws(unlist(lapply(strsplit(salary$Classification[k], "-"), function(x) x[2])), "left"))

} else {

They are letters jaim

}

}

j-harbin commented 5 months ago

Note that in this case "restructure" values do not have adjustment values before them. In this case I am assuming that "restructure" is 2019 (?).

image image

j-harbin commented 5 months ago

Fixed in commit 7ff0197f286e10c74a735a7c5128954d385b5182 of dataSPA