Displaying 1 result from an estimated 1 matches for "datadf".
Did you mean:
data_f
2009 Dec 02
4
sort a data frame by a vector
Hi,
I have a a vector and a data frame with two columns
vec = c("C", "A", "B")
dataDF = data.frame(A1 = c("B", "A", "C"), A2 = c(1,2,3))
I would like to sort the data frame by column A1 such that the order of
elements in A1 is as the same as in vec.
After the ordering, the data frame would be
A1 A2
C 3
A 2
B...