I have the following data frame
dd <- data.frame(b = c("High", "Medium", "Highest", "Low", "Not bad","Good", "V. Good"), x = c("C3", "C1", "C4", "N2", "C2", "N1","N4"), x = c("5", "2", "3", "6", "7", "5","7") )
so I want the data frame to be converted using manual order for the variable X.
for example: what is the source
1 High C3 5 2 Medium C1 2 3 Highest C4 3 4 Low N2 6 5 Not bad C2 7 6 Good N1 5 7 V. Good N4 7
but I want a new data frame to start based on the value of X, but not in alphabetical order, but arbitrarily in the order I chose, for example:
the first row has x=C1, the second have x=C2, the third have x=N4, ...etc
How can I do that?
Thank you
source share