0

I have two columns, one entitled 'Area' and one entitled 'Age'. I am looking to present these in a graph grouped by area and then by custom age band. Below code changes the ages in to the correct values that are required but can anyone advise necessary code to then create an object that groups by Area then by age, i.e. similar to below table example?

MyData["Age"] = cut(MyData$Age, c(0, 17, 24, 44, 64, 84, Inf), c("0-17", "18-24", "25-44", "45-64", "65-84", "85+" ), include.lowest=TRUE)
Area 0-17 18-24
Area1 3 5
Area2 5 7

0 Answers0