digits: Test, convert numbers

Description Usage Arguments Value Author(s) Examples

Description

Test, convert numbers

Usage

1
2
3

Arguments

str

Vector of strings

base

Integer, base of number representation used in r2B

Value

allDigits The strings contain digits only which are allowable in base 'base'.
isNumeric Test whether the elements of a character vector represent legal numbers only.
str2dig Convert a string to a vector of integers.

Author(s)

Christian W. Hoffmann <christian@echoffmann.ch>

Examples

1
2
3
4
5
  allDigits(c("1231","89a8742")) #  TRUE FALSE
  isNumeric(c("1231","8.9e-2",".7d2")) # [1]  TRUE  TRUE FALSE
  str2dig("13245.") #  1 3 2 4 5 NA
    # for comparison, big numbers:
  int(10^(7:10)) # 10000000 100000000 1000000000 NA

cwhmisc documentation built on May 1, 2019, 7:55 p.m.