Learn R Programming

diyar (version 0.4.0)

encode: Labelling in diyar

Description

Encode and decode character and numeric values.

Usage

encode(x, ...)

decode(x, ...)

# S3 method for default encode(x, ...)

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

# S3 method for default decode(x, ...)

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

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

# S3 method for d_label [(x, i, ..., drop = TRUE)

# S3 method for d_label [[(x, i, ..., drop = TRUE)

Arguments

x

[d_label|atomic]

...

Other arguments.

i

i

drop

drop

Value

d_label; atomic

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.

Examples

Run this code
# NOT RUN {
cds <- encode(rep(LETTERS[1:5], 3))
cds

nms <- decode(cds)
nms
# }

Run the code above in your browser using DataLab