Skip to content

selecting unique columns of a matrix/data frame

2 messages · Stephen Nyangoma, James W. MacDonald

#
Hi all,
I have a very high dimensional data and apparently there are several
columns that contain similar information (some columns are equal). I
want to form a matrix/data frame consisting of unique columns. Does
anyone have an efficient way of getting out these columns. A small
section of the data frame is given below.

Thanks for helping.

Stephen.
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
 [1,]  107  125  149  149  165  125  172  172  149   149   107   125  
 [2,]  185  171  150  150  299  171  173  173  150   150   185   171   
 [3,]    0  193  177  177  618  193  343  343  177   177     0   193    
 [4,]    0    0  178  178    0    0  365    0  178   178     0     0    
 [5,]    0    0  223  223    0    0    0    0  223   223     0     0    
 [6,]    0    0  245  245    0    0    0    0  245   245     0     0    
 [7,]    0    0  246  246    0    0    0    0  246   246     0     0    
 [8,]    0    0  466  466    0    0    0    0  466   466     0     0    
 [9,]    0    0  467  467    0    0    0    0  467   467     0     0    
[10,]    0    0  468  468    0    0    0    0  468     0     0     0 

  
##################################################################################
#
Stephen Nyangoma wrote:

            
?unique