Native Shell
Native Shell:AI 生成的 UI,在你的应用中原生呈现,覆盖每个平台。iOS、Android、macOS、Windows 与 Linux 上的应用、GPUI 应用与网页在运行时加载已签名、沙箱隔离的 TSX 模块并绘制 th
AI 翻译
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
翻译准备中
开发工具GitHub @bayesiandemography在线运营者未确认
试用过了吗? 点一下就好,无需登录。
尚未收集仓库信息。
尚未检测到更新。GitHub 发布版本后会显示在这里。
Work with labels for age groups, periods, and cohorts
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 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