camr_add_inventory_item: Add Individual Inventory Item With Codebook Entry

View source: R/R06-Inventories_scales_questionnaires.R

camr_add_inventory_itemR Documentation

Add Individual Inventory Item With Codebook Entry

Description

Convenience function to add a column with scores for an individual item or question from an inventory, survey, or questionnaire. Can also add the associated codebook entry for the item.

Usage

camr_add_inventory_item(
  dtf_original,
  dtf_new,
  chr_original_column,
  chr_new_column,
  vec_response_options = NULL,
  vec_new_values = NULL,
  lst_values_and_labels = "",
  chr_inventory = "",
  chr_question = "",
  chr_description = "",
  ...
)

Arguments

dtf_original

A data frame with the column of scores for the given item or question.

dtf_new

A data frame to which the column of scores will be added.

chr_original_column

A character string, the column name in dtf_original to add.

chr_new_column

A character string, the new column name to use in dtf_new.

vec_response_options

A vector, the original response options. Used to recode the response options if needed.

vec_new_values

A vector, the new values to replace vec_response options with. Must match in length to vec_response_options.

lst_values_and_labels

A named list with 'content' containing the numeric values and 'additional_content' containing the labels or interpretations for the values.

chr_inventory

A character string, the name of the inventory, survey, or questionnaire to which the item belongs.

chr_question

A character string, the item's framing question.

chr_description

A character string, allows a user to specify a custom description rather than one auto-filled using chr_inventory and chr_question.

...

Additional arguments for the camr_add_codebook_entry function.

Value

A data frame with an additional column containing the scores for the individual item or question.


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