Reframe data of class canregs or fbswicds
cr_reframe(x, strat = "registry")
# S3 method for class 'canregs'
cr_reframe(x, strat = "registry")
# S3 method for class 'fbswicds'
cr_reframe(x, strat = "registry")
Reframed canregs or fbswicds.
# list reframe vars that could be used in `strat` parameter
ls_vars("reframe")
#> # A tibble: 6 × 5
#> code cname ename abbr_cn abbr_en
#> <chr> <chr> <chr> <chr> <chr>
#> 1 areacode 中国行政区划代码 China administrative division code 行政区划…… Areaco…
#> 2 registry 登记处代码 Cancer Registry codes expressed as… 登记处 Regist…
#> 3 province 省份代码 Province expressed as administrati… 省份 Provin…
#> 4 city 城市代码 City expressed as administrative d… 城市 City
#> 5 area_type 地区类型代码 Area type expressed as 6 digits co… 地区类型…… Area T…
#> 6 region 中国区域代码 Region in China express as digits … 区域 Region
data("canregs")
# Reframe the `canregs` data according to `area_type` attribute
city <- cr_reframe(canregs, strat = "area_type")
# Reframe object with class of `canregs`
# Reframe the `canregs` according to the `province` attribute
province <- cr_reframe(canregs, strat = "province")
class(province)
#> [1] "canreg" "list"
names(province)
#> [1] "areacode" "FBcases" "SWcases" "POP"
# Reframe object with class of `fbswicds`
# Convert object with class of `canregs` into object with class of `fbswicds`
fbsw <- count_canreg(canregs, cancer_type = "small")
# Reframe the `fbswicds` according to the `city` attribute
city <- cr_reframe(fbsw, strat = "city")