get_diff_want_is: Diff want is

Description Usage Arguments Details Value

View source: R/validate-fields.R

Description

This function returns an integer inticating the difference between how many columns of a certain type are required VS how many columns of that type exist in the data (as validated by validated_columns).

Usage

1
2
3
4
5
6
7
get_diff_want_is(
  id_required,
  id_found,
  id_meets_requirements,
  validated_columns,
  field
)

Arguments

id_required

Boolean, whether or not the data must have a column with the specific id/name

id_found

Boolean, whether the specific id/name has been found in the data

id_meets_requirements

If id_found == TRUE, whether id meets field requirements

validated_columns

Tibble of validated columns

field

List of field specifications

Details

If diff_want_is = 0, there are as many columns of a certain type available as required. If diff_want_is > 0, there are fewer columns of a certain type than required. If diff_want_is < 0, there are more columns of a certain type than required.

In the special case that id_required (if a column is required to have a certain column name/id), then diff_want_is = 0 if that column id exists in the data and it meets the requirements, otherwise diff_want_is = -1

Value

Integer


datasketch/dsvalidate documentation built on Sept. 3, 2021, 7:12 a.m.