search for: afpstrata

Displaying 1 result from an estimated 1 matches for "afpstrata".

2012 Aug 09
1
Using unicode symbol has unexpected results in levels of factor object
...d symbol, but an explicitly built legend using the same labels did. Example (I am trying to get the less than or equal to symbol): > .df <- data.frame(afp = c(0,0,1,1), time=c(0,2,0,1), surv=c(1, 0.5, 1, 0.4)) > afpLabels <- c("AFP \u2264 16", "AFP > 16") > afpStrata <- factor(.df$afp, labels=afpLabels) > afpStrata [1] AFP ? 16 AFP ? 16 AFP > 16 AFP > 16 Levels: AFP = 16 AFP > 16 The first level is reported as "AFP = 16". > levels(afpStrata) [1] "AFP ? 16" "AFP > 16" > The desired result is produced with...