powered by
generate a matrix to show whether the item in each element of a list
exist_matrix(x, n_lim = 0, n_top = NULL, sort_items = NULL)
tibble
list of character vectors
n limit to keep items in result
only keep top n items in result
function to sort the items, item frequency by default
x <- 1:5 %>% purrr::map( ~ gen_char(to = "k", n = 5, random = TRUE, seed = .x) ) exist_matrix(x)
Run the code above in your browser using DataLab