Algorithm to build TNM stage from cTNM and pTNM variables

Viewed 10

I was wondering whether someone is aware of an R algorithm able to build TNM stage (I,II,III,IV) for cancer diseases using variables about cT, cN, cM, pT, pN, pM, ypTMM and version of TNM classification?

1 Answers

Use case_when:

TNM = case_when(cT < 3 & cN == 0 & cM == 0 ~ 1,
          cM == 1 ~ 4)

...

Related