Skip to contents

Count canreg data.

Usage

count_canreg(
  x,
  cutage_method = "distance",
  breaks = c(0, 15, 40, 65),
  length = 5,
  maxage = 85,
  sep_zero = TRUE,
  labels = NULL,
  label_tail = NULL,
  cancer_type = "big"
)

# S3 method for class 'canregs'
count_canreg(x, ...)

# S3 method for class 'canreg'
count_canreg(
  x,
  cutage_method = "distance",
  breaks = c(0, 15, 40, 65),
  length = 5,
  maxage = 85,
  sep_zero = TRUE,
  labels = NULL,
  label_tail = NULL,
  cancer_type = "big"
)

Arguments

x

Object data of class 'canreg' or 'canregs'.

cutage_method

Methods for Specifying Age Groups. Options are "interval", "distance", or "quantile". Default is "distance".

breaks

Specify the break points classify age groups when cutage_method is 'interval'. Default is 'c(0, 15, 40, 65)'.

length

Specify the length of each age group when cutage_method is 'distance'. Default is 5.

maxage

Specify the max age of age group when cutage_method is 'distance'. Default is 85.

sep_zero

Logical value, TRUE or FALSE, specifying whether to treat age 0 as a separate group. Default is TRUE.

labels

Labels for age groups. Default is NULL.

label_tail

Tail label to be added to the labels. Default is NULL.

cancer_type

A character string specifying the classification method used to categorize ICD-10 codes. This determines how ICD-10 codes are classified. Options include "big" (classify ICD-10 codes into 26 cancer categories), "small" (classify ICD-10 codes into 59 cancer categories, more specific categories), "system" (classify ICD-10 codes into organ system), and "gco" (classify ICD-10 code into cancer categories same as classification published by the Global Cancer Observatory). This parameter is only available when the input data is a vector of ICD-10 codes, or object with class of 'canreg' or 'canregs'.

...

Parameters.

Value

data of class fbswicd.

Examples

library(canregtools)
file <- system.file("extdata", "411721.xls", package = "canregtools")
data <- read_canreg(file)
fbsw <- count_canreg(data, cutage_method = "interval")
fbsw
#> $areacode
#> [1] "411721"
#> 
#> $fbswicd
#>       year   sex  agegrp cancer   fbs   sws    mv    ub   sub m8000   dco
#>      <int> <int>  <fctr>  <int> <int> <int> <int> <int> <int> <int> <int>
#>   1:  2016     1 0-14 岁     60    10     6     8     0     6     2     0
#>   2:  2016     1 0-14 岁     61    10     6     8     0     6     2     0
#>   3:  2016     1 0-14 岁    101     0     0     0     0     0     0     0
#>   4:  2016     1 0-14 岁    102     0     0     0     0     0     0     0
#>   5:  2016     1 0-14 岁    103     0     0     0     0     0     0     0
#>  ---                                                                     
#> 220:  2016     2  65+ 岁    122    17     9     1     0     6     9     2
#> 221:  2016     2  65+ 岁    123     3     0     3     0     0     0     0
#> 222:  2016     2  65+ 岁    124    11    12     6     0     8     0     0
#> 223:  2016     2  65+ 岁    125     5     6     5     0     3     0     0
#> 224:  2016     2  65+ 岁    126    14    11    13     1     3     1     0
#> 
#> $sitemorp
#>      year   sex cancer               site               morp
#>     <int> <int>  <int>             <list>             <list>
#>  1:  2016     2    101  <data.frame[3x2]>  <data.frame[3x2]>
#>  2:  2016     1    101  <data.frame[8x2]>  <data.frame[4x2]>
#>  3:  2016     2    124  <data.frame[8x2]>  <data.frame[9x2]>
#>  4:  2016     2    102  <data.frame[1x2]>  <data.frame[2x2]>
#>  5:  2016     1    102  <data.frame[1x2]>  <data.frame[1x2]>
#>  6:  2016     1    103  <data.frame[7x2]>  <data.frame[8x2]>
#>  7:  2016     2    103  <data.frame[4x2]>  <data.frame[3x2]>
#>  8:  2016     1    104  <data.frame[5x2]>  <data.frame[6x2]>
#>  9:  2016     2    104  <data.frame[6x2]>  <data.frame[7x2]>
#> 10:  2016     1    124  <data.frame[7x2]>  <data.frame[8x2]>
#> 11:  2016     1    126 <data.frame[23x2]> <data.frame[11x2]>
#> 12:  2016     2    126 <data.frame[20x2]> <data.frame[20x2]>
#> 13:  2016     2    105 <data.frame[11x2]>  <data.frame[6x2]>
#> 14:  2016     1    105  <data.frame[9x2]>  <data.frame[6x2]>
#> 15:  2016     1    106  <data.frame[4x2]>  <data.frame[6x2]>
#> 16:  2016     2    106  <data.frame[4x2]>  <data.frame[4x2]>
#> 17:  2016     2    107  <data.frame[3x2]>  <data.frame[4x2]>
#> 18:  2016     1    107  <data.frame[3x2]>  <data.frame[5x2]>
#> 19:  2016     1    108  <data.frame[3x2]>  <data.frame[5x2]>
#> 20:  2016     2    108  <data.frame[2x2]>  <data.frame[4x2]>
#> 21:  2016     1    109  <data.frame[2x2]>  <data.frame[1x2]>
#> 22:  2016     2    109  <data.frame[1x2]>  <data.frame[1x2]>
#> 23:  2016     1    110  <data.frame[6x2]>  <data.frame[5x2]>
#> 24:  2016     2    110  <data.frame[5x2]>  <data.frame[6x2]>
#> 25:  2016     1    111  <data.frame[2x2]>  <data.frame[3x2]>
#> 26:  2016     2    111  <data.frame[1x2]>  <data.frame[1x2]>
#> 27:  2016     1    112  <data.frame[3x2]>  <data.frame[3x2]>
#> 28:  2016     2    112  <data.frame[4x2]>  <data.frame[2x2]>
#> 29:  2016     2    125 <data.frame[10x2]> <data.frame[11x2]>
#> 30:  2016     1    125  <data.frame[9x2]> <data.frame[10x2]>
#> 31:  2016     1    113  <data.frame[2x2]>  <data.frame[1x2]>
#> 32:  2016     2    113  <data.frame[2x2]>  <data.frame[1x2]>
#> 33:  2016     2    114  <data.frame[5x2]> <data.frame[14x2]>
#> 34:  2016     1    114  <data.frame[1x2]>  <data.frame[1x2]>
#> 35:  2016     2    115  <data.frame[3x2]>  <data.frame[5x2]>
#> 36:  2016     2    116  <data.frame[3x2]>  <data.frame[5x2]>
#> 37:  2016     2    117  <data.frame[1x2]>  <data.frame[9x2]>
#> 38:  2016     1    118  <data.frame[1x2]>  <data.frame[2x2]>
#> 39:  2016     1    119  <data.frame[2x2]>  <data.frame[2x2]>
#> 40:  2016     1    120  <data.frame[4x2]>  <data.frame[8x2]>
#> 41:  2016     2    120  <data.frame[3x2]>  <data.frame[4x2]>
#> 42:  2016     2    121  <data.frame[1x2]>  <data.frame[4x2]>
#> 43:  2016     1    121  <data.frame[1x2]>  <data.frame[3x2]>
#> 44:  2016     1    122 <data.frame[11x2]>  <data.frame[5x2]>
#> 45:  2016     2    122  <data.frame[8x2]>  <data.frame[5x2]>
#> 46:  2016     1    123  <data.frame[1x2]>  <data.frame[5x2]>
#> 47:  2016     2    123  <data.frame[1x2]>  <data.frame[5x2]>
#>      year   sex cancer               site               morp
#> 
#> $pop
#>     year   sex   agegrp    rks
#>    <int> <int>   <fctr>  <int>
#> 1:  2016     1  0-14 岁  80846
#> 2:  2016     1 15-39 岁 180929
#> 3:  2016     1 40-64 岁 155155
#> 4:  2016     1   65+ 岁  38723
#> 5:  2016     2  0-14 岁  70475
#> 6:  2016     2 15-39 岁 165617
#> 7:  2016     2 40-64 岁 144124
#> 8:  2016     2   65+ 岁  46148
#> 
#> attr(,"class")
#> [1] "fbswicd" "list"