matches_coding | R Documentation |
Performs to check to see if the set of vector values are equal to or a subset of a coding's values.
matches_coding(vec, coding, ignore_empty = TRUE)
verify_matches_coding(vec, coding, ignore_empty = TRUE)
vec |
A vector |
coding |
A 'coding' object |
ignore_empty |
Logical flag to skip check if coding is empty |
TRUE/FALSE
verify_matches_coding()
: Rather than returning TRUE/FALSE, this function
halts execution if 'matches_coding()' returns FALSE.
vec1 <- sample(1:2, 10, replace = TRUE)
vec2 <- sample(0:1, 10, replace = TRUE)
cdng <- coding(code("Yes", 1), code("No", 0))
matches_coding(vec1, cdng)
matches_coding(vec2, cdng)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.