I am trying to define groupings from levels of factor variables and this the 
warning message that R give 

 "& not meaningful for factors".

The nature of my task is this. I have a variable stage which has the levels 
(1B, 2A, 2B) - these are the AJCC TNM stages of cancer, and another variable 
diameter with factor levels ("=< 4", "4 - 6.5, > 6.5; limit values are 
exclusive). 

I am trying to define series of groupings based on these variables and others 
like them. 

My first attempts were;

1. node1  <- data.trt[data.trt$stage=="1B" &  data.trt$diameter=="=< 4"] 
2.  data.trt$stage[data.trt$stage=="1B"]& 
data.trt$diameter[data.trt$diameter=="=< 4"]

The second attempt was purely a fishing exercise.

R gave me the waring message:

Warning message:
In Ops.factor(data.trt$stage[data.trt$stage == "1B"], 
data.trt$diameter[data.trt$diameter ==  :
  & not meaningful for factors


My question is how do I get round this and by implication is there an 
alternative way of defining a logical operation applicable to factors.

Thanks already for the help.

Philip


A Smile costs Nothing  

     But Rewards Everything

Happiness is not perfected until it is shared
                                                              -Jane Porter      
  


       
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to