opendatasus_arquivos: Expand downloadable files from OpenDataSUS resources

View source: R/opendatasus.R

opendatasus_arquivosR Documentation

Expand downloadable files from OpenDataSUS resources

Description

Some OpenDataSUS resources, notably state-level influenza-like illness datasets, publish several file parts as links inside the resource description instead of the primary URL field. This function expands both representations to one row per downloadable file.

Usage

opendatasus_arquivos(
  conjunto,
  recurso = NULL,
  formato = NULL,
  cache = TRUE,
  atualizar = FALSE
)

Arguments

conjunto

Dataset slug returned by [opendatasus_catalogo()].

recurso

Optional exact resource name or identifier.

formato

Optional resource format.

cache

Whether to cache portal metadata for the duration controlled by option 'datasus.cache_ttl'.

atualizar

Whether to ignore cached metadata and query the portal again.

Value

A data frame with one row per downloadable file and its parent resource identifier, part number and URL.

Examples


old_options <- options(
  datasus.timeout = 5,
  datasus.download_timeout = 15,
  datasus.max_tries = 1
)
try({
opendatasus_arquivos(
  "notificacoes-de-sindrome-gripal-leve-2024",
  recurso = "Dados MS - 20/12",
  formato = "CSV"
)
})
options(old_options)


datasus documentation built on Oct. 7, 2026, 1:07 a.m.