You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When specific breaks are defined for the age_categories() function, there is special formatting for the upper number, but the lower number is incorrectly formatted as a range with itself.
For example, if the lowest number is 0, the label for the first category will be 0-0.
Proposed solution:
I think it should be reformatted to be less than the second number in the list of breaks, i.e. if the breaks are 0, 1, 5, 10 the first label should be <1.
Reprex below:
# Load epikit:
library(epikit)
# Vector of ages in years:age<- c(3, 1, 8, 1, 0.5, 6, 7, 2, 11, 15)
# Create age categories:agegroups<-epikit::age_categories(x=age, breakers= c(0, 1, 5, 10))
# Combine into a data.frame and sort ascending by age:df<-data.frame(age, agegroups) %>% arrange(age)
Problem:
When specific breaks are defined for the
age_categories()
function, there is special formatting for the upper number, but the lower number is incorrectly formatted as a range with itself.For example, if the lowest number is 0, the label for the first category will be
0-0
.Proposed solution:
I think it should be reformatted to be less than the second number in the list of breaks, i.e. if the breaks are
0, 1, 5, 10
the first label should be<1
.Reprex below:
This gives the following results:
The text was updated successfully, but these errors were encountered: