Native Shell
Native Shell: AI-generated UI, native in your app, on every platform. Apps on iOS, Android, macOS, Windows and Linux, GPUI apps and web pages load signed, sandboxed TSX modules at run time and draw th
Work with vectors of age, period, and cohort labels. Infer the intervals underlying labels, and use this information to validate, reformat, and manipulate the labels. Common tasks such as filtering on
Developer toolsGitHub @bayesiandemographyOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
Repository information has not been collected yet.
No updates detected yet. GitHub releases will appear here.
Work with labels for age groups, periods, and cohorts
Taken from the repository README
Loading the full README.
Read the full README ↗Work with age, period, and cohort labels.
install.packages("agetime")
Functions for
library(agetime)
Create a new set of labels.
period_labels_five(lower_first = 2001, lower_last = 2026)
#> [1] "2001-2006" "2006-2011" "2011-2016" "2016-2021" "2021-2026" "2026-2031"
Standardize existing labels.
x <- c("2003 to 2005", "2012--2015", "2000-2005")
period_standard(x)
#> [1] "2003-2005" "2012-2015" "2000-2005"
Calculate widths.
x <- c("10-14", "infants", "1-4")
age_width(x)
#> [1] 5 1 4
Filter and sort on age.
library(dplyr, warn.conflicts = FALSE)
df <- data.frame(
age = c("0-14", "100+", "15-39"),
count = c(100, 40, 200)
)
df
#> age count
#> 1 0-14 100
#> 2 100+ 40
#> 3 15-39 200
df |>
filter(age_lower(age) >= 15) |>
arrange(age_lower(age))
#> age count
#> 1 15-39 200
#> 2 100+ 40
vignette("agetime") for a quick startvignette("cookbook") for task-oriented recipesvignette("troubleshooting") for solutions to common problems?agetime for a full list of functions grouped by task