Learn R Programming

rock (version 0.8.1)

rpe_create_source_with_items: Create a source with items to code for Response Process Evaluation

Description

This function creates a plain text file, a .rock source, that can be coded when conducting Response Process Evaluation.

Usage

rpe_create_source_with_items(
  data,
  iterationId,
  batchId,
  populationId,
  itemVarNames,
  metaquestionIdentifiers,
  metaquestionVarNames,
  itemContents,
  metaquestionContents,
  coderId,
  caseIds = NULL,
  outputFile = NULL,
  preventOverwriting = rock::opts$get("preventOverwriting"),
  encoding = rock::opts$get("encoding"),
  silent = rock::opts$get("silent")
)

Value

The created source, as a character vector (invisibly);

Arguments

data

A (wide) data frame containing at least the participants' answers to the items and to the meta questions (but optionally, the iteration, batch, and population).

iterationId, batchId, populationId

If the iteration, batch, and population identifiers are contained in the data frame passed as data, the variable names holding that information for each participant; otherwise, either a single value or a vector of length nrow(data) that contains that information for each participant.

itemVarNames

The variable names with the participants' responses to the items, in a named character vector, with each element's name being the item's identifier, and each element the variable name in data holding the participants' responses to the item.

metaquestionIdentifiers

A named list of unnamed character vectors, with each character vector element specifying the identifier of a meta question, and each list element (i.e. the name of each character vector) specifying the item identifier that the meta questions in the corresponding character vector belong to.

metaquestionVarNames

The variable names with the participants' responses to the meta questions, in a named character vector, with each element's name being the meta question's identifier, and each element the variable name in data holding the participants' responses to the meta question.

itemContents

A named character vector with each item's content, with the values being the content and the names the item identifiers.

metaquestionContents

A named character vector with each meta question's content, with the values being the content and the names the meta question identifiers.

coderId

The identifier of the coder that will code this source.

caseIds

The variable name with the participants' case identifiers (i.e. a unique identifier for each participant).

outputFile

Optionally, a file to write the source to.

preventOverwriting

Whether to overwrite existing files (FALSE) or prevent that from happening (TRUE).

encoding

The encoding to use when writing the source(s).

silent

Whether to the silent (TRUE) or chatty (FALSE).