Toot

Written by Krzysztof Sakrejda on 2024-08-27 at 17:11

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

Mentions

Tags

=> View rstats tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113035097485279699
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
284.337396 milliseconds
Gemini-to-HTML Time
0.367442 milliseconds

This content has been proxied by September (3851b).