How can I manually change the order of the facets while using the function gather? The figures in the grid are not presented in the order I defined in myvars.
Here's the code:
myvars <- c("1","2","3","4","5"
,"6","7","8","9","10",
"11","12","13","14")
DataVars<- Data[myvars]
DataVars%>%
gather(-1, key = "var", value = "value") %>%
ggplot(aes(x = value, y = 1)) +
facet_wrap(~ var, scales = "free") +
geom_jitter(size = 0.5, shape = 16, aes(colour = var),width = 0.5, height = 0.5) +
geom_smooth(method="lm", size = 1, color = "black", level=0.95)
Thanks in advance!