Returns the number of rows that would be returned by a SITUAS report query without downloading the full dataset.

situas_get_report_count(pfun, date = Sys.Date(), date_end = NULL)

Arguments

pfun

Integer. Report ID (function number). See list_available_reports for a list of valid report IDs.

date

Date, POSIXct, or character string. The reference date for the report. For DATA type reports, this is the single date parameter. For PERIODO type reports, this is the start date. Defaults to current date.

date_end

Date, POSIXct, or character string. End date for PERIODO type reports. Leave NULL for DATA type reports. Defaults to NULL.

Value

Integer. The number of rows in the report.

Examples

if (FALSE) { # \dontrun{
# Check how many municipalities exist today
count <- situas_get_report_count(pfun = 61)
print(count)  # Should be around 7896

# Check report size before downloading
if (situas_get_report_count(pfun = 73) < 10000) {
  data <- situas_get_report_data(pfun = 73)
}
} # }