Searches through available SITUAS reports using keywords in titles or descriptions. Supports filtering by analysis type and date range. This function provides a convenient way to discover relevant reports without knowing their specific IDs.

search_reports(
  keywords = NULL,
  analysis_type = NULL,
  pfun_range = NULL,
  exact_match = FALSE
)

Arguments

keywords

Character vector or single string. Keywords to search for in report titles. If NULL (default), returns all reports. Case-insensitive. Multiple keywords are combined with OR logic.

analysis_type

Character vector. Filter by analysis type. Valid values are "DATA", "PERIODO", and "ATTUALIZZAZIONE". If NULL (default), includes all types.

pfun_range

Integer vector of length 2. Filter reports by ID range, e.g., c(60, 80) returns reports with IDs between 60 and 80 (inclusive). If NULL (default), includes all IDs.

exact_match

Logical. If TRUE, only returns reports where the entire title matches the keyword (case-insensitive). If FALSE (default), returns reports containing any of the keywords.

Value

A data.table with columns:

pfun

Report ID (integer)

title

Full report title in Italian (character)

analysis_type

Analysis type: DATA, PERIODO, or ATTUALIZZAZIONE (character)

date_range

Validity period of the report (character)

info

Additional information (character, may be NA)

Details

Analysis Types:

  • DATA: Single date parameter. Use for reports that show territorial units at a specific date.

  • PERIODO: Date range parameters (start and end). Use for reports showing changes over a period.

  • ATTUALIZZAZIONE: Actualization/translation between dates. Uses date range like PERIODO but focuses on code translations.

Examples

if (FALSE) { # \dontrun{
# Find all reports about municipalities (comuni)
comuni_reports <- search_reports("comuni")

# Find reports about provinces or regions
admin_reports <- search_reports(c("province", "regioni"))

# Find only DATA type reports about municipalities
comuni_data <- search_reports("comuni", analysis_type = "DATA")

# Find reports in a specific ID range
reports_60_70 <- search_reports(pfun_range = c(60, 70))

# Find exact title match
exact_report <- search_reports("Elenco Regioni", exact_match = TRUE)

# Browse all available reports
all_reports <- search_reports()
} # }