Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

convertIntegers

Conversion for integer vector.


Description

Convert numeric vector to integer vector if the numeric vector fully represents an integer vector, e.g. c(1, 5) to c(1L, 5L). Otherwise the argument is returned unchanged.

Usage

convertIntegers(x)

Arguments

x

[any]
Argument.

Value

Either an integer vector if conversion was done or x unchanged.

Examples

str(convertIntegers(1.0))
str(convertIntegers(1.3))
str(convertIntegers(c(1.0, 2.0)))
str(convertIntegers("foo"))

BBmisc

Miscellaneous Helper Functions for B. Bischl

v1.11
BSD_2_clause + file LICENSE
Authors
Bernd Bischl [aut, cre], Michel Lang [aut], Jakob Bossek [aut], Daniel Horn [aut], Jakob Richter [aut], Dirk Surmann [aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.