Skip to contents

Retrieves one or more tables from IRW and returns them as tibbles. If the table includes a character resp column, the function attempts to coerce it into numeric. Strings like "NA", "", and NA are treated as missing values. A warning is issued only if other non-numeric values are encountered.

Usage

irw_fetch(name, sim = FALSE, dedup = FALSE, comp = FALSE, resp = FALSE)

Arguments

name

Character vector of one or more table names (IRW table IDs).

sim

Logical, optional. If TRUE, fetches from the IRW simulation dataset (irw_simsyn). Defaults to FALSE.

dedup

Logical, optional. If TRUE, deduplicates responses based on timing variables. Defaults to FALSE.

  • If a 'date' column is present, no deduplication is performed.

  • If only a 'wave' column is present, one random response is retained per (id, item) group within each wave.

  • If neither 'date' nor 'wave' is present, one random response is retained per (id, item) pair.

comp

Logical, optional. If TRUE, fetches from the IRW competition dataset (irw_competitions). Defaults to FALSE.

resp

Logical, optional. If TRUE, returns response matrix via irw_long2resp(). Defaults to FALSE.

Value

If a single name is provided, returns a tibble. If multiple, returns a named list of tibbles (or error messages, if retrieval failed).

Examples

if (FALSE) { # \dontrun{
# Main IRW data
irw_fetch("environment_ltm")

# Deduplicated
irw_fetch("pks_probability", dedup = TRUE)

# Simulation data
irw_fetch("gilbert_meta_3", sim = TRUE)

# Competition data
irw_fetch("collegefb_2021and2022", comp = TRUE)
} # }