encode {dst}R Documentation

Convert a value to its representation in another chosen base

Description

The aplEncode function of the project APL in R (https://rpubs.com/deleeuw/158476) has been adapted to follow the standard implementation of the APL encode function.

Usage

encode(base, ind)

Arguments

base

A numeric vector which describes the number system in which we want to recode the data.

ind

The value to convert represented by a number or a numeric vector.

Value

A vector or a matrix of the data converted.

Author(s)

Claude Boivin

References

Examples

encode(c(2,2,2,2), 11)  # find the base 2 representation of number 11
encode(c(365,24,60), 2997) # convert 2997 minutes to days-hrs-min.

[Package dst version 1.6.0 Index]