#' @title Get the LAST year of the Census time series
#'
#' @description Identifica e extrai o último ano da série histórica do censo
#'
#' @param tb_censo_full \code{tibble} contendo a base completa do censo
#' após tratamento e limpeza por meio da função \code{\link{extract_and_clean_censo_full}}.
#'
#' @return \code{vector} do tipo \code{numeric} contendo o ano final da série.
#'
#' @family get_ano
#'
#' @examples
#' \dontrun{
#'
#' ano_LAST_censo <- get_year_LAST_censo(tb_censo_full)
#'
#' }
#' @export
#'
get_year_LAST_censo <- function(tb_censo_full) {
# obtem ano do ultimo censo
ano_LAST_censo <- tb_censo_full %>% # import magrittr pro namespace
dplyr::summarise(max(lubridate::year(NU_ANO_CENSO))) %>%
dplyr::collect() %>%
unlist()
return(unname(ano_LAST_censo))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.