Convert strings to integers according to the given base using the C
strtol, or choose a suitable base following the C rules.
a character vector, or something coercible to this by
an integer which is between 2 and 36 inclusive, or zero (default).
Conversion is based on the C library function
For the default
base = 0L, the base chosen from the string
representation of that element of
x, so different elements can
have different bases (see the first example). The standard C rules
for choosing the base are that octal constants (prefix
X) and hexadecimal constants (prefix
0X) are interpreted as base
16; all other strings are interpreted as base
For a base greater than
Z) are used to represent
An integer vector of the same length as
x. Values which cannot
be interpreted as integers or would overflow are returned as
For decimal strings
as.integer is equally useful.
1 2 3
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.