View source: R/naaccr_factor.R
naaccr_factor | R Documentation |
Replace NAACCR codes with understandable factors
naaccr_factor(x, field, keep_unknown = FALSE, ...)
x |
Vector (usually character) of codes. |
field |
String giving the XML name of the NAACCR field to code. |
keep_unknown |
Logical indicating whether values of "unknown" should be
a level in the factor or |
... |
Additional arguments passed onto |
A factor
vector version of x
. The levels are short
descriptions instead of the basic NAACCR codes. Codes which stood for
"unknown" with no further information are replaced with NA
.
If field
names a text or site-specific field, x
will be
returned unchanged with a warning.
naaccr_factor(c("20", "43", "99"), "radRegionalRxModality") naaccr_factor(c("USA", "GER", "XEN"), "addrAtDxCountry") # Default: NA for unknowns, naaccr_factor(c("1", "8", "9"), "tumorGrowthPattern") naaccr_factor(c("1", "8", "9"), "tumorGrowthPattern", keep_unknown = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.