Skip to contents

Identifies datasets in the Item Response Warehouse (IRW) based on user-defined criteria. This function filters datasets using precomputed metadata, which contains summary statistics for each dataset (e.g., number of responses, number of participants, density scores, etc.), as well as tag-based metadata (e.g., age range, construct type, sample type, etc.).

Usage

irw_filter(
  n_responses = NULL,
  n_categories = NULL,
  n_participants = NULL,
  n_items = NULL,
  responses_per_participant = NULL,
  responses_per_item = NULL,
  density = c(0.5, 1),
  var = NULL,
  age_range = NULL,
  child_age__for_child_focused_studies_ = NULL,
  construct_type = NULL,
  sample = NULL,
  measurement_tool = NULL,
  item_format = NULL,
  primary_language_s_ = NULL,
  longitudinal = NULL
)

Arguments

n_responses

Numeric vector of length 2 specifying range for total responses.

n_categories

Numeric vector of length 2 specifying range for unique response categories.

n_participants

Numeric vector of length 2 specifying range for number of participants.

n_items

Numeric vector of length 2 specifying range for number of items.

responses_per_participant

Numeric vector of length 2 specifying range for avg responses per participant.

responses_per_item

Numeric vector of length 2 specifying range for avg responses per item.

density

Numeric vector of length 2 specifying range for data density. Default c(0.5, 1); disable with NULL.

var

A character vector specifying one or more variables. For a list of available variables, see: https://datapages.github.io/irw/standard.html - If exact variable names are provided, only datasets containing all specified variables will be returned. - If a variable name contains an underscore (e.g., "cov_", "Qmatrix_"), the function will match all datasets that contain at least one variable that starts with that prefix.

age_range

Character value specifying the age group of participants (e.g., "Adult (18+)", "Child (<18y)").

child_age__for_child_focused_studies_

Character value indicating the age group for child-focused studies (e.g., "Early (<6y)").

construct_type

Character value specifying the psychological or educational construct being measured.

sample

Character value specifying the sample type or recruitment method (e.g., "Educational", "Clinical").

measurement_tool

Character value specifying the type of instrument used for measurement (e.g., "Survey/questionnaire").

item_format

Character value describing the format of the items (e.g., "Likert Scale/selected response").

primary_language_s_

Character value indicating the primary language(s) used in the instrument.

longitudinal

Logical or NULL. If TRUE, returns only longitudinal datasets (i.e., those with variables like 'wave' or 'date'). If FALSE, excludes those datasets. If NULL (default), includes all datasets.

Value

Sorted character vector of dataset names matching all specified criteria or empty if none found.

Details

Exploring Metadata and Tags

To understand available dataset properties before filtering, run summary(irw_metadata()). To explore tag-based metadata, use irw_tags() to view the full tags table.

To see the valid values for a specific tag column (e.g., "age_range"), use: irw_tag_options("column_name")

Examples

if (FALSE) { # \dontrun{
irw_filter(n_responses = c(1000, Inf), var = "rt")
irw_filter(var = "wave", density = NULL)
irw_filter(n_participants = c(500, Inf), density = c(0.3, 0.8))
irw_filter(var = c("treat", "rt", "cov_"), density= NULL)

# View valid options for a tag column
irw_tag_options("construct_type")

irw_filter(construct_type = "Affective/mental health")
} # }