validate_column_mapping: Validate column mapping

View source: R/utils.R

validate_column_mappingR Documentation

Validate column mapping

Description

Function validates a column mapping

Usage

validate_column_mapping(col.map)

Arguments

col.map

expects a valid "column mapping", that is a data frame-like object that

  1. inherits from data.frame

  2. has two columns named "colname" and "accepted_types"

  3. "colname" is type character and "accepted_types" is a list column

  4. has at least one row

  5. each element of "accepted_types" is a complete (non-NA) character vector

  6. the lengths of "accepted_types" is ≥ 1 for all its elements

Value

a list with two elements

result

a logical indicating whether col.map is a valid column mapping data frame

message

a character vector, recording the reason why col.map is invalid if result is FALSE


haukelicht/politicaltweets documentation built on July 3, 2023, 4:11 a.m.