pni_doses: Read individual PNI dose records

View source: R/contemporary-data.R

pni_dosesR Documentation

Read individual PNI dose records

Description

Downloads anonymous vaccination records published in monthly files by the National Immunization Program. This record-level source complements the aggregated historical TABNET series returned by [pni_imunizacoes()].

Usage

pni_doses(
  ano = "last",
  mes = "last",
  formato = "CSV",
  destino = NULL,
  cache = TRUE,
  atualizar = FALSE,
  n_max = Inf,
  colunas = NULL,
  normalizar = FALSE,
  ...
)

Arguments

ano

Dataset year from 2020 onwards, or '"last"' for the most recent annual dataset currently published.

mes

Month number, Portuguese month name, or '"last"' for the latest month currently published in the selected year and format.

formato

File format, '"CSV"' or '"JSON"'.

destino

Optional destination file or existing directory.

cache

Whether to reuse the local OpenDataSUS cache.

atualizar

Whether to force a fresh metadata query and download.

n_max

Maximum number of rows to read.

colunas

Optional character vector selecting columns during CSV parsing.

normalizar

Whether to apply the curated contemporary schema with [datasus_padronizar()].

...

Additional arguments passed to the underlying reader.

Value

The parsed OpenDataSUS resource with provenance metadata.

References

OpenDataSUS. Doses aplicadas pelo Programa Nacional de Imunizações. https://dadosabertos.saude.gov.br/dataset?query=doses+aplicadas+PNI

Examples


old_options <- options(
  datasus.timeout = 5,
  datasus.download_timeout = 15,
  datasus.max_tries = 1
)
try({
doses <- pni_doses(ano = 2025, mes = 1, n_max = 1000)
})
options(old_options)


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