search for: group_modifi

Displaying 3 results from an estimated 3 matches for "group_modifi".

Did you mean: group_modify
2024 May 24
1
dplyr, group_by and selective action according to each group
Dear RHelp-list, ?? Using dplyr and the group_by approach on a dataframe, I want to be able to apply a specific action according to the group name. The code bellow works, but I am not able to write it in a more esthetic way using dplyr. Can somebody help me to find a better solution ? Thank you Best regards Laurent df_test <- data.frame( x1=1:9, x2=1:9,
2024 May 24
1
dplyr, group_by and selective action according to each group
Laurent: As I don't use dplyr, this won't help you, but I hope you and others may find it entertaining anyway. If I understand you correctly (and ignore this if I have not), there are a ton of ways to do this in base R, including using switch() along the lines you noted in your post. However, when the functions get sufficiently complicated or numerous, it may be useful to store them in a
2024 May 25
1
dplyr, group_by and selective action according to each group
Although there may well be many ways to do what is being asked for with the tidyverse, sometimes things are simple enough to do the old-fashioned way. The request seems to have been to do something to all rows in ONE specific group but was phrased in the sense of wanting to know which group your functionality is being called in. What grouping gains you is more worthwhile if you are interested in