[datatable-help] reorder data frame columns (not manually)

Manabu Sakamoto manabu.sakamoto at gmail.com
Fri Mar 17 11:42:07 CET 2017


I don't think this is a data.table specific question, but you can use order:

dt[order(V), ] for data.table object...

or

df[order(df$V), ] for data.frame object



On 17 March 2017 at 10:33, glaporta <bioglp at gmail.com> wrote:

> Hi,
> is it possible to reorder (not manually) the data frame columns on the
> basis
> of their value?
> Thanks,
> Gianandrea
>
> xxx <- data.frame(matrix(runif(8), ncol=8))
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/
> reorder-data-frame-columns-not-manually-tp4729802.html
> Sent from the datatable-help mailing list archive at Nabble.com.
> _______________________________________________
> datatable-help mailing list
> datatable-help at lists.r-forge.r-project.org
> https://lists.r-forge.r-project.org/cgi-bin/mailman/
> listinfo/datatable-help
>



-- 
Manabu Sakamoto, PhD
manabu.sakamoto at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/datatable-help/attachments/20170317/7f51ac21/attachment.html>


More information about the datatable-help mailing list