Skip to contents

Dictionary class low level constructor

Usage

new_dic(
  x,
  item_name = NULL,
  item_label = NULL,
  values = NULL,
  value_labels = NULL,
  missing = NULL,
  weight = 1,
  type = NULL,
  recodes = NULL,
  class = "item",
  ...,
  .list = NULL,
  .coerce_class = TRUE,
  .message_attr = FALSE
)

Arguments

x

A variable

item_name

Character

item_label

Character

values

Numeric or character vector with values. The vector can be named

value_labels

Character of the form value = label; value2 = label2

missing

Numeric or character vector with values

weight

numeric

type

defaults to data type of x

recodes

Recoding information e.g. 4 = 1, .default = 0

class

default is "item"

...

further dic arguments (e.g. source = "James (1891)")

.list

An alternative way to provide class arguments as a list (overwrites previous arguments)

.coerce_class

Logical. If TRUE, tries to coerce classes of 'x' if class does not match the type argument

.message_attr

Logical. For internal use

Value

An item of class dic.

Examples

x <- new_dic(1:100, item_label = "The label of this item")