search for: subcomb

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

Did you mean: subcomp
2016 Apr 15
0
a replace for subset
...t=factor(sample(c("ON","OFF"),100,TRUE)), OR=factor(sample(c("S","T"),100,TRUE)), PAT=factor(sample(c("low","high","middle"),100,TRUE))) Then you can create logical expressions for all combinations of your levels like this: subcomb<-expand.grid(list(levels(mydata$COUNTRY), levels(mydata$Light),levels(mydata$OR),levels(mydata$PAT))) Then you can loop through this data frame creating a string that corresponds to your logical expression: for(subsetter in 1:dim(subcomb)[1]) { subexpr<-paste(names(mydata)[3:6],subcomb[su...