encode {diyar}R Documentation

Labelling in diyar

Description

Encode and decode character and numeric values.

Usage

encode(x, ...)

decode(x, ...)

## Default S3 method:
encode(x, ...)

## S3 method for class 'd_label'
encode(x, ...)

## Default S3 method:
decode(x, ...)

## S3 method for class 'd_label'
decode(x, ...)

## S3 method for class 'd_label'
rep(x, ...)

## S3 method for class 'd_label'
x[i, ..., drop = TRUE]

## S3 method for class 'd_label'
x[[i, ..., drop = TRUE]]

Arguments

x

[d_label|atomic]

...

Other arguments.

i

i

drop

drop

Details

To minimise memory usage, most components of pid, epid and pane are integer objects with labels. encode() and decode() translates these codes and labels as required.

Value

d_label; atomic

Examples

cds <- encode(rep(LETTERS[1:5], 3))
cds

nms <- decode(cds)
nms

[Package diyar version 0.5.1 Index]