A data set to work with:
df <- tibble::tribble(~person, ~age, ~height,
"John", 1, 20,
"Mike", 3, 50,
"Maria", 3, 52,
"Elena", 6, 90,
"Biden", 9, 120)
I am trying to get a data frame
that would have the following structure:
age | height(cm) | number of people
0-5 | 0-50 | 2
0-5 | 50-100 | 1
0-5 | 100-200 | 0
5-10 | 0-50 | 0
5-10 | 50-100 | 1
5-10 | 100-200 | 1
Basically, I have a data set that has a lot of information about a certain number of people. And I want to categorize this first by their age and inside of each age group to have a height group and in the end the number of people that belong in those categories.
any tips?