Created
August 15, 2016 15:12
-
-
Save cimentadaj/f6fd1577e8b93e269d8f0ae546e23c54 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
## Two continuous variables | |
ggplot(data=housing, aes(x = Home.Value, y= Structure.Cost)) + stat_identity() # Is the same as geom_point() | |
ggplot(housing, aes(x = Home.Value, y= Structure.Cost, color=region)) + stat_smooth() # Is the same as geom_smooth() | |
## One continuous and one categorical | |
ggplot(data=housing, aes(x = region, y= Home.Value)) + stat_boxplot() # Is the same as geom_boxplot() | |
ggplot(housing, aes(x = region, y= Structure.Cost, color=region)) + stat_ydensity() # Is the same as geom_violin() | |
## One categorical | |
ggplot(data=housing, aes(x = region)) + stat_count() # Is the same as geom_bar() | |
## One continuous | |
ggplot(data=housing, aes(x = Home.Value)) + stat_bin() # Is the same as geom_histogram() | |
ggplot(data=housing, aes(x = Home.Value)) + stat_density() # Is the same as geom_density() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment