camr_collected_over: Categories over which Data was Collected

View source: R/R07-Codebook.R

camr_collected_overR Documentation

Categories over which Data was Collected

Description

Function to list the categories (e.g., experimental groups, study time points) over which data was collected. Useful for denoting the specific subset of categories data was collected over (e.g., if data was only collected at a baseline time point). Output can be passed to the Collected_over argument for the camr_new_codebook_entry function.

Usage

camr_collected_over(dtf, x, y, missing_values = NULL, non_standard = TRUE)

Arguments

dtf

A data frame.

x

The variable for the collected data (non-standard evaluation possible).

y

The variable with the categories (non-standard evaluation possible).

missing_values

An optional logical vector indicating missing data (must match in length to x). If NULL assumes NA values are the only indicator of missing data.

non_standard

A logical value; if TRUE uses non-standard evaluation for x and y, otherwise assumes they are character strings.

Value

A list with two vectors: content with the categories from y over which there was non-missing data, and additional_content listing the column name for y.

Author(s)

Kevin Potter

Examples

data( example_CAM_data_set )

example_CAM_data_set |>
  camr_collected_over( INV.INT.HADS_anxiety, SSS.CHR.Session )

example_CAM_data_set |>
  camr_collected_over( INV.DBL.BPI_severity, SSS.CHR.Event )


rettopnivek/camrprojects documentation built on March 26, 2024, 9:17 a.m.