Learn R Programming

HPZoneAPI (version 1.1.0)

HPZone_convert_dates: Converts all relevant columns in the dataset to Date types.

Description

Based on the available fields, a date for statistics is automatically generated, using the following logic: If cases: Date_of_onset > Datum_melding_aan_de_ggd > Case_creation_date. If situations: Start_date > Situation_creation_date If enquiries: Received_on > Date_closed

Usage

HPZone_convert_dates(
  data,
  search = "dat(e|um)|Received_on",
  statdate = "Date_stat"
)

Value

An equivalent data.frame with Date types in the correct columns. Additionally, a column called 'Date_stat' is added, see Details.

Arguments

data

A dataset returned by the API.

search

Column names to search for. Default: anything containing 'date' or 'datum'.

statdate

Desired column name for the date for statistics field.

Examples

Run this code
if (FALSE) {
HPZone_request("cases", "basic", where=c("Case_creation_date", ">", "2025-01-01")) |>
  HPZone_convert_dates()
}

Run the code above in your browser using DataLab