relabel: Relabel question items and options

View source: R/relabel.R

relabelR Documentation

Relabel question items and options

Description

This function is a passthrough that allows you to relabel question items, options, question descritions and notes before writing to latex or excel. The relabeling must occur in questionnaire order. As it is received by crunch, so should it be set by your relabeling objects.

Usage

relabel(ct, ...)

Arguments

ct

An object from crosstabs, recontact_toplines, or trackingReport

...

One or more relabel objects. See relabelSet

Details

There are two important warnings to consider:

  • Relabeling should always occur before applying any kind of sorting using the sortAliases function to avoid situations where labels could be applied inappropriately.

  • If your results object is a tracking report or recontact it is strongly recommended that you set your wave labels in the recontact_toplines or trackingReport. However, if you must set it here options would be the categories and items would be the wave names. We cannot account for aliases with only partial data (n-1 waves), you must set the wave names in order.

Examples

## Not run: 
library(crunchtabs)
login()

ds <- loadDataset("Example dataset")
ct <- crosstabs(ds)
ct <- relabel(ct,
  list(
    alias = "q1",
    options = c("Lovely Cat", "Smelly Dog", "Annoying Bird"), # Cat, Dog, Bird
    description = "Which pet do you love the most?"), # What is your favorite pet?
    notes = "Relabeled by an undeniable cat-lover" # No note before
  list(alias = "petloc",
    options = c("Lovely Cat", "Smelly Dog", "Annoying Bird"), # Cat, Dog, Bird
    items = c("In my home", "At my work")) # Home, Work
)
writeLatex(ct, pdf = TRUE)

## End(Not run)


Crunch-io/crunchtabs documentation built on Jan. 31, 2023, 12:14 p.m.