[BioC] Help with rearranging dataframe

Sean Davis seandavi at gmail.com
Tue Sep 29 21:47:04 CEST 2009

On Tue, Sep 29, 2009 at 3:39 PM, Hari Easwaran <hariharan.pe at gmail.com> wrote:
> Hi all,
> I have another question with handling dataframes.
> I have a dataframe with the 1-st column as probenames (agilent) and the
> remaining columns are the intensity values from multiple samples. I want to
> order this table such that the order of the probenames correspond to the
> order of the genes on the chromosome. To do this I have another table which
> has teh probenames in this order.

Probably the simplest way is to merge the two data.frames first.  See
the merge() function.  After merging, then do your reordering on the
merged data.frame.


> For example:
> probename           sample1          sample2          sample3
> sample4 ...
> a                              v11
> v12                    v13                  v14
> d                              v21
> v22                    v23                  v24
> b                              v31                        v32
>    v33                  v34
> c                               v41                       v42
>     v43                  v45
> e                               v51                        v52
>    v53                  v54
> I want the above table to be rearranged such that the 1st column is in the
> order a,b,c,d,e and the correspondig values (v11, v12, etc) are also
> appropriately rearranged.
> Thanks a lot for any help/suggestions.
> Sincerely,
> Hari
>        [[alternative HTML version deleted]]
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

More information about the Bioconductor mailing list