grapes-contains-grapes: Test if a list contains some elements of the desired class.

Description Usage Arguments Value Examples

Description

Test if a list contains some elements of the desired class.

Test if a list does not contain some elements of the desired class.

Test if a list contains only elements of the desired class.

Usage

1
2
3
4
5
match_list %contains% expected_class

match_list %does_not_contain% expected_class

match_list %contains_only% expected_class

Arguments

match_list

list. The list to test for class of the elements.

expected_class

character. The name of the expected class to test.

Value

Boolean whether or not the match_list has at least one element of expected_class.

Boolean whether or not the match_list has no elements of the expected_class.

Boolean whether or not the match_list has all elements of expected_class.

Examples

1
2
3
4
5
  list(1, 2, 3) %contains% numeric
  list(1, 2, "a") %contains% numeric
  list(1, 2, 3) %does_not_contain% character
  list(1, 2, 3) %contains_only% numeric
  list(1, 2, "a") %contains_only% numeric

peterhurford/quickcheckr documentation built on May 25, 2019, 1:50 a.m.