datasus_build_path: Build DATASUS FTP paths from filters

View source: R/datasus_catalog.R

datasus_build_pathR Documentation

Build DATASUS FTP paths from filters

Description

Builds candidate FTP directories for a given source and file type. For SIH/SIA, the function selects historical vs. current trees by year/month. For SIM and SINASC, preliminary trees are included when requested.

Usage

datasus_build_path(
  source,
  file_type,
  year = NULL,
  month = NULL,
  include_prelim = TRUE
)

Arguments

source

Source code (e.g. "SIHSUS").

file_type

File type code (e.g. "RD").

year

Integer vector of years.

month

Integer vector of months.

include_prelim

Logical. Include preliminary trees when available (default TRUE).

Value

A tibble with columns source, file_type, period, and path.

Examples

datasus_build_path(source = "SIHSUS", file_type = "RD", year = 2024, month = 1)

datasusr documentation built on Sept. 26, 2026, 1:08 a.m.