as_numeric_nowarn: convert factor or vector to numeric without warnings

Description Usage Arguments Details Value Functions Examples

View source: R/util.r

Description

correctly converts factors to vectors, and then converts to numeric or integer, which may silently introduce NAs. Invisible rounding errors can be a problem going from numeric to integer, so consider adding tolerance to this conversion. asIntegerNoWarn silently floors.

Usage

1
2
3
4
5
6
7
as_numeric_nowarn(x)

as_integer_nowarn(x)

is_integerish(x, tol = 1e-09, na.ignore = FALSE)

areIntegers(x, tol = 1e-09, na.ignore = FALSE)

Arguments

x

is a vector, probably of numbers of characters

tol

tolerance when considering if two numbers are integers, default 1e-9

na.ignore

logical, if TRUE will pass through NA values, otherwise, they are marked FALSE.

Details

"are" functions return a value for each input, where is "allIs" functions return a single logical.

Value

numeric vector, may have NA values

logical vector

Functions

Examples

1

jwutil documentation built on May 7, 2019, 1:03 a.m.