rescale_yes_no_4: Rescale level yes-no four levels

Description Usage Arguments Examples

Description

This is a wrapper function around the rescale_categories function.

Usage

1
2
3
4
rescale_yes_no_4(column, from = c("Yes, definitely", "Yes, to some extent",
  "No, not really", "No, definitely not"), to = c(2, 1, -1, -2),
  na_labels = c("DK"), underscore = TRUE, exact_from = TRUE,
  return_class = "numeric")

Arguments

column

A column from a survey data with a four-level agreement scale.

from

Defaults to c("Yes, definitely", "Yes, to some extent", "No, not really", "No, definitely not").

to

Defaults to c(2,1,-1,2) ) If return_class = "character" or return_class = "factor" is selected it returns the abbreviated category names c("definitely", "maybe", "maybe_not", "definitely_not").

na_labels

Defaults to c("DK").

underscore

Defaults to TRUE in which case factor names or character strings contain underscore_between_words. This is a better approach for further programming, but you can choose FALSE for nicer printing results. See examples.

exact_from

Deafults to TRUE. If FALSE you can use the partial matching, but beware that in this case, "twenty" will be replaced by

return_class

Default is "numeric", alternatives "character" or "factor".

Examples

1
2
3
rescale_yes_no_4  (c("Yes, definitely", "Yes, to some extent",
                        "No, not really", "No, definitely not", "Missing"),
                      na_labels = "Missing")

antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.