Learn R Programming

grr (version 0.9.5)

convertBase: Convert string representations of numbers in any base to any other base.

Description

Convert string representations of numbers in any base to any other base.

Usage

convertBase(x, base1 = 10, base2 = 10)

Arguments

x
a vector of integers or strings to be converted
base1
the base of x
base2
the base of the output

See Also

as.octmode

as.hexmode

strtoi

Examples

Run this code

identical(convertBase(1234,base2=8),as.character(as.octmode(1234)))

convertBase(17771,base1=8,base2=30)
convertBase(17771,base1=8,base2=10)
convertBase(8185,base1=10,base2=30)

Run the code above in your browser using DataLab