Skip to content

sort data frame columns according to a list

4 messages · Jie Zhang, David Winsemius, Jun Shen

#
So your second dataframe, say DF2, has sample IDs in one of its  
columns, say "colnames", (or are they in in the names?)

( Examples and output of str() are requested to avoid exactly such  
ambiguity.)

If it is the former, then;

DF1[ , DF2colnames ]   # could do it.
#
On Mar 16, 2009, at 5:05 PM, David Winsemius wrote:

            
^
DF1[ , DF2$colnames ]
David Winsemius, MD
Heritage Laboratories
West Hartford, CT