format_contract()
takes in a single contract number and returns a consistently-formatted
contract number, according to user controls for the output.
format_contract(contract, hyphenated = TRUE, master_only = FALSE)
A character string in the specified format.
# control the output with the two logical parameters
format_contract("FA8616-14-D-6060:0001",
hyphenated = TRUE,
master_only = FALSE)
#> [1] "FA8616-14-D-6060-0001"
format_contract("FA8620-15-G-4040-0039",
hyphenated = TRUE,
master_only = TRUE)
#> [1] "FA8620-15-G-4040"
format_contract("FA8620-15-G-4040-FA8620-15-F-4040",
hyphenated = FALSE,
master_only = TRUE)
#> [1] "FA862015G4040"
format_contract("FA862015C4040",
hyphenated = FALSE,
master_only = FALSE)
#> [1] "FA862015C4040"