0

in my datatable, there are seven column(V1 to V7) and 100 rows. I would like to sort column V5 and V7 ascending and descending order respectively. I used the following code:

datatable1<- datatable [with(datatable, order (V5, -V7)), ]

But it is giving error message. If i do not put "-" sign before V7, both columns are arranged in ascending order. How can I arranged in ascending and descending order (V1 and V7 respectively)? Thanks.

camille
  • 16,432
  • 18
  • 38
  • 60
John
  • 1
  • no, it is not working properly. – John Nov 30 '19 at 02:08
  • `library(tidyverse) yourdata %>% arrange(V5, -V7)`. – Zhiqiang Wang Nov 30 '19 at 02:32
  • Does this answer your question? [How to order a data frame by one descending and one ascending column?](https://stackoverflow.com/questions/7793295/how-to-order-a-data-frame-by-one-descending-and-one-ascending-column) – camille Nov 30 '19 at 04:21

0 Answers0