assign_data_type: Assign a type of data given a set of data types to match.

Description Usage Arguments Details Value

View source: R/assign_data_type.R

Description

Assign a type of data given a set of data types to match.

Usage

1
assign_data_type(x, col_names, no_match = warning)

Arguments

x

A data.frame or list of data.frames to detect the data type

col_names

A named list where the names are the data type and the values are required column names (additional column names may be present in the data).

no_match

What should be done if no data type matches 'x'? (Typically this will be one of 'stop', 'warning', or 'message', but it can be any function taking a single character argument.)

Details

To detect a data type, first 'col_names' is sorted by number of columns provided so that more matching names are matched rather than fewer. Then, the first among the sorted 'col_names' list is selected.

Value

'x' with classes of the data type and "filetype_mappings" added.


billdenney/filetype.mappings documentation built on Feb. 3, 2020, 5:41 a.m.