Skip to contents

Downloads a table, storing the result in the local cache directory. Subsequent calls with the same table return the cached copy.

Usage

vigiar_baixar_com_cache(tabela, max_age = 86400, refresh = FALSE, ...)

Arguments

tabela

Table name.

max_age

Maximum cache age. Can be a difftime, number of seconds, or Inf (never expire).

refresh

If TRUE, forces a new download.

...

Additional arguments passed to vigiar_baixar().

Value

A tibble (cached or freshly downloaded).

Examples

# \dontrun{
vigiar_conectar()
#> Sessao VIGIAR ja esta ativa. Use refresh = TRUE para renovar.
dados <- vigiar_baixar_com_cache("df_anual")
#> ℹ Cache miss: baixando 'df_anual'...
#> ℹ Baixando tabela 'df_anual'...
#> ℹ Filtro UF='RJ' (UF): 0 linhas (de 30000).
#> ✔ Tabela 'df_anual' baixada: 0 linhas x 7 colunas (30.5s)
#> ✔ Cache salvo: df_anual
# }