Skip to contents

see which columns seem numeric and could be rounded, e.g. - DRAFT NOT FULLY TESTED

Usage

is.numericish(
  x,
  only.if.already.numeric = FALSE,
  strip.characters.before.coerce = FALSE
)

Arguments

x

data.table, data.frame, or vector

only.if.already.numeric

logical, if TRUE, only reports TRUE for a column (or element) if is.numeric() is TRUE for that one

strip.characters.before.coerce

logical, if TRUE, tries to remove spaces and percentage signs before trying to coerce to numeric

Value

logical vector as long as NCOL(x) i.e., is length(x), if x is table, or length(x) if vector

Details

Does not report "08" as numeric-ish, so cannot check fips with leading zero this way, e.g. To do that you could check if is.na(as.numeric(x)) but "08" is not roundable.