Mood for an #rstats Rube-Goldberg machine?
grouping_filters = function(data, grouping) { grouping = rlang::enquos(grouping) data_groups = dplyr::select(data, !!!grouping) |> unique() filters = data_groups |> purrr::pmap(list) |> purrr::map(purrr::imap, ~ list(rlang::sym(.y), .x)) |> purrr::map(purrr::map, ~ rlang::expr(expr = !!(.x[[1]]) == !!(.x[[2]]))) |> purrr::map( ~ {names(.x) = NULL; .x}) filters }
Surely no one will regret writing this function.
=> More informations about this toot | View the thread | More toots from wronglang@bayes.club
=> View rstats tag This content has been proxied by September (3851b).Proxy Information
text/gemini