I am new to this place, so I hope I'm doing things the right way.
I'm having soms trouble to summarize multiple filtergroups, and am looking for some help.
I looked at the other topics, but can't seem to find a matching one for my problem.
I have a dataset consisting of multiple columns, but the 2 important for this task are age_buyer and selling_price.
I would like to summarize for tha ages 18-35, 36-50, 51-80.
For example I made 3 groups using this code:
I can do this for 1 filter, and this work perfect, but can't seem to figure out how to do this in 1 line of code for all 3? Any help would be appreciated.
Hello.
Thanks for providing code , but you could take further steps to make it more convenient for other forum users to help you.
Share some representative data that will enable your code to run and show the problematic behaviour.
You might use tools such as the library datapasta, or the base function dput() to share a portion of data in code form, i.e. that can be copied from forum and pasted to R session.
In advance of that, I would suggest that there is no need to filter your original dataset, rather use mutate() and case_when() to assign appropriate group labels, this will then be leveraged in the following summarize().