Converts ICD-O-3 topography codes in to a numeric format. It removes the "C" from the beginning of the string if present, and ensures that the codes are valid ICD-O-3 site codes.
site_convert(x, validate = TRUE)
Returns a converted ICD-O-3 topography code in a numeric format.
Takes in a character or numeric vector of ICD-O-3 site codes and converts them to a standardized numeric format. The function will remove the "C" from the beginning of the string if present. It will also automatically detect if the codes have are in decimal ("C34.1") or integer ("C341") format and convert them.
If validate
is set to TRUE
, the function checks if the topography
codes are valid ICD-O-3 site codes for neoplasms which range from
C00.0 to C97.0. Any invalid codes will be set to NA
and a warning will be
issued indicating the number of invalid codes found.