expect_type_fields: Identify fields with specified type

Description Usage Arguments Value See Also

Description

Get the field names of dataframe with specified type.

Usage

1
2
3
4
5
6
7
8
expect_type_fields(
  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

A vectors of field names with specified type. If no field is expect type, return a character(0).

See Also

Other utils_fields: is_type_field(), verify_fields()


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