Skip to content
Prev 285229 / 398502 Next

help with matrix column cleaning

On Feb 14, 2012, at 12:46 AM, Vijayan Padmanabhan wrote:

            
This will give you a logical vector which you can use with "[" in the  
column position to select those columns:


  apply(teams, 2, function(x) length( unique(substr(x, 1,1))) ==3 )

  [1] FALSE FALSE FALSE FALSE FALSE FALSE FALSE  TRUE  TRUE FALSE   
TRUE  TRUE
[13]  TRUE  TRUE FALSE FALSE FALSE  TRUE  TRUE FALSE  TRUE  TRUE   
TRUE  TRUE
[25] FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE FALSE