What is your favorite R function you've learned this 2024?
Mine: I've loved understanding !! and enquo from rlang.
#rstats
Mine: I've loved understanding !! and enquo from rlang.
#rstats
Comments
Thanks a lot for sharing! Now I have new ingredients to try 💙
https://mc-stan.org/posterior/articles/rvar.html
I've used other packages in the past but I like how straightforward these functions are.
xq <- enquo(x)
and injecting it with later
f(!!xq)
https://rlang.r-lib.org/reference/embrace-operator.html
# The injection operators {{, !!, and !!! are an extension of the
# R syntax developed for tidyverse packages.
# !! plus enquo() OR the embrace operator: {{ }}
# !!! is used to splice a list/vector of some sort into arguments of some quoting expression.
https://bsky.app/profile/djnavarro.net/post/3ldkxevtlys2o
Also, I feel that the grouping is mostly an auxiliary to the other verb, so it makes more sense for me as an argument.
Finally, I don't find it compact or implicit, so it works for me 💯
Reading you, I might stop using group_by() -even though I find it intuitive, it might simplify my classes. I hadn't thought about it 😅