View source: R/check_membership.R
check_membership | R Documentation |
This function filters a list of tibbles based on whether a key variable's value is among the membership values. It first uses check_key_vars() to ensure the key variable exists, then checks membership. Useful for keeping only specific students or participants.
check_membership(tibble_list, key_var, membership, verbose = FALSE)
tibble_list |
A named list of tibbles, each containing an "id" column and an "answer" column |
key_var |
A character string specifying the key variable to check |
membership |
A character vector of allowed values for the key variable |
verbose |
Logical indicating whether to report removed items (default: FALSE) |
A list of tibbles where the key variable exists and its value is in the membership list
## Not run:
# Create sample data with student emails
path <- file.path(find.package("tutorial.helpers"), "tests/testthat/fixtures/answers_html")
tibble_list <- gather_submissions(path, "stop")
result <- check_membership(tibble_list,
key_var = "email",
membership = c("bluebird.jack.xu@gmail.com",
"hassan.alisoni007@gmail.com"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.