Learn R Programming

events (version 0.5)

make_scale: Make an event scale

Description

Makes an event scale

Usage

make_scale(name, types = NULL, values = NULL, file = NULL, desc = "", default = NA, sep = ",")

Arguments

name
Name of scale
types
Array of event codes
values
Array of event code values
file
Input file defining event codes and their values
desc
Optional description of the scale
default
What to assign event codes that have no mapping in the scale. Defaults to NA.
sep
Separator in file

Value

An event scale object

Details

Makes an event scale from a specification found in a file or using the types and variables parameters. If a file is specified it is assumed to be headerless and to contain event codes in the first column and numerical values in the second column.

Scales must be assigned a name and may also be assigned a description. If you wish to assign codes without a specified value to some particular value, set default to something other than NA.