Skip to content

Commit

Permalink
warning message for new vintage arg
Browse files Browse the repository at this point in the history
  • Loading branch information
walkerke committed Mar 18, 2024
1 parent 4a940d3 commit ec6232b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions R/estimates.R
Expand Up @@ -71,6 +71,17 @@ get_estimates <- function(geography = c("us", "region", "division", "state", "co
output = "tidy", geometry = FALSE, keep_geo_vars = FALSE,
shift_geo = FALSE, key = NULL, show_call = FALSE, ...) {

if (missing(vintage) && year > 2020) {
rlang::warn(c("`get_estimates()` now uses the `vintage` argument to specify the PEP vintage, and the `year` argument to isolate a year within that vintage.",
"!" = "This may be a breaking change in your code",
"!" = "Omitting `vintage` may lead to incorrect or unexpected results."))
}

if (year > 2020) {
rlang::inform(sprintf("Using the Vintage %s Population Estimates", vintage))
}


geography <- rlang::arg_match(geography)

if (shift_geo) {
Expand Down

0 comments on commit ec6232b

Please sign in to comment.