is_type_field: Check whether fields are specified type

Description Usage Arguments Value Note See Also

View source: R/utils-fields.R

Description

Predicate fields of dataframe are specified type or not.

Usage

1
2
3
4
5
6
7
8
is_type_field(
  data,
  expect_type = c("numeric", "integer", "double", "character", "date", "factor",
    "list", "NA"),
  negate = FALSE,
  predicate_fun = NULL,
  ...
)

Arguments

data

A vector of date/timestamps.

expect_type

A character of type to test, e.g. "numeric", "integer", "double", "character", "date", "factor", "list", "NA"

negate

A logic flag of whether to negate expect_type of not, Default FALSE means not to negate the expect_type.

predicate_fun

A function used as testing, return TRUE if matched. Default NULL means not to use predicate_fun for testing.

...

Params to predicate_fun.

Value

return a vectors of logical with same length of names of dataframe.

Note

numeric means integer or double; double don't include date.

See Also

Other utils_fields: expect_type_fields(), verify_fields()


chriszheng2016/zstmodelr documentation built on June 13, 2021, 8:59 p.m.