Last active
August 16, 2016 22:29
-
-
Save cimentadaj/86fb2bd4c448151117404ec410f7595f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Create boxplot and remove the outliers | |
o <- ggplot(housing[!is.na(housing$region), ], aes(x=region, y=Land.Price.Index)) + geom_boxplot(outlier.shape = NA) | |
# The options from scale_*_discrete are practically the same as scale_*_continuous except limits. | |
# Remember that limits controls the minimum and maximum of the chosen axis. Given that this is | |
# a categorical discrete axis, it doesn't make any sense to define neither. Instead, you control the order of categories. | |
o + scale_x_discrete(name="Region", | |
breaks=waiver(), | |
labels=waiver(), | |
limits=c("N. East", "South", "West", "Midwest")) # Notice how I change the order of the categories |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment