Google News
logo
R - Quiz(MCQ)
Which of the following sort a dataframe by the order of the elements in B?
A)
x[rev(x$B),]
B)
x[order(x$B),]
C)
x[ordersort(x$B),]
D)
x[rev(order(x$B)),]

Correct Answer :   x[rev(order(x$B)),]


Explanation : x[rev(order(x$B)),] sort the dataframe in reverse order.

Advertisement