Created
June 17, 2021 18:34
-
-
Save aurielfournier/1a2b32b4682eac4828d498bef2d11e08 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dat <- data.frame(x=c("C-1","C-2","C-10"), | |
y=c(1,2,3)) | |
# in the wrong order | |
ggplot(data=dat, aes(x=x, y=y))+ | |
geom_point() | |
dat$x <- factor(dat$x, levels=dat$x) | |
# in the right order | |
ggplot(data=dat, aes(x=x, y=y))+ | |
geom_point() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment