I have the following dataset
and I would like the order in the "Crowding" column to be the following: "Uncrow", "CrowGr", "CrowUng".
I have the following dataset
and I would like the order in the "Crowding" column to be the following: "Uncrow", "CrowGr", "CrowUng".
Here's a simple solution using dplyr
.
I've created a dummy code there to test it. Would be best in the future to post reproducible examples though for people to answer.
library(dplyr)
Params_data_long <- data.frame(Crowding = c("CrowGr", "CrowGr", "Uncrow", "CrowGr", "Uncrow","CrowUng"),
Participant = c(1, 2, 1, 3, 4, 2))
Params_data_long <- Params_data_long %>%
arrange(factor(Crowding, levels = c("Uncrow", "CrowGr", "CrowUng")))