R/dplyr_summarizers.R

Defines functions .unique_as_list .table_sorted_from_list .table_sorted

.table_sorted <- function(semtype_vec) {
    semtypes <- stringr::str_split(semtype_vec, ",") %>% unlist()
    tab <- sort(table(semtypes), decreasing = TRUE)
    list(tab)
}

.table_sorted_from_list <- function(l) {
    result <- l %>% unlist() %>% table() %>% sort(decreasing = TRUE)
    list(result)
}

.unique_as_list <- function(x) {
    list(unique(x))
}
lmyint/rsemmed documentation built on July 26, 2021, 1:20 a.m.