dat <-
dplyr::tribble(
~ ageg, ~ ncan,
'00_04', 0,
'05_09', 0,
'10_14', 0,
'15_19', 0,
'20_24', 1,
'25_29', 2,
'30_34', 4,
'35_39', 5,
'40_44', 1,
'45_49', 10,
'50_54', 14,
'55_59', 1,
'60_64', 2,
'65_69', 2,
'70_74', 5,
'75_79', 1,
'80_84', 0,
'85', 0
)
custom_ageg_aggregation(dat, 0)
custom_ageg_aggregation(dat, 5)
custom_ageg_aggregation(dat, 10)
custom_ageg_aggregation(dat, 100)
Run the code above in your browser using DataLab