encode: Convert a value to its representation in another chosen base

View source: R/encode.R

encodeR 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

  • Jan de Leeuw and Masanao Yajima (March 07, 2016) APL in R (Version 009), Source code. https://rpubs.com/deleeuw/158476

  • L. Gilman and A. J. Rose.(1974): APL an Interactive Approach, Second Edition, John Wiley, New York.

  • APL 68000 Level II language manual. MicroAPL Ltd. 1990.

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.

dst documentation built on Nov. 16, 2023, 5:08 p.m.