forked from dreamRs/esquisse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
updated ggcall & quietly require hrbrthemes and ggthemes
- Loading branch information
Showing
4 changed files
with
124 additions
and
89 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# Default: | ||
ggcall() | ||
|
||
# With data and aes | ||
ggcall("mtcars", list(x = "mpg", y = "wt")) | ||
|
||
# Evaluate the call | ||
library(ggplot2) | ||
eval(ggcall("mtcars", list(x = "mpg", y = "wt"))) | ||
|
||
|
||
# With a geom: | ||
ggcall( | ||
data = "mtcars", | ||
mapping = list(x = "mpg", y = "wt"), | ||
geom = "point" | ||
) | ||
|
||
# With options | ||
ggcall( | ||
data = "mtcars", | ||
mapping = list(x = "hp", y = "cyl", fill = "color"), | ||
geom = "bar", | ||
coord = "flip", | ||
labs = list(title = "My title"), | ||
theme = "minimal", | ||
facet = c("gear", "carb"), | ||
theme_args = list(legend.position = "bottom") | ||
) | ||
|
||
# Theme | ||
ggcall( | ||
"mtcars", list(x = "mpg", y = "wt"), | ||
theme = "theme_minimal", | ||
theme_args = list( | ||
panel.ontop = TRUE, | ||
legend.title = rlang::expr(element_text(face = "bold")) | ||
) | ||
) | ||
|
||
# Theme from other package than ggplot2 | ||
ggcall( | ||
"mtcars", list(x = "mpg", y = "wt"), | ||
theme = "ggthemes::theme_economist" | ||
) | ||
|
||
|
||
# One scale | ||
ggcall( | ||
data = "mtcars", | ||
mapping = list(x = "mpg", y = "wt", color = "qsec"), | ||
geom = "point", | ||
scales = "color_distiller", | ||
scales_args = list(palette = "Blues") | ||
) | ||
|
||
# Two scales | ||
ggcall( | ||
data = "mtcars", | ||
mapping = list(x = "mpg", y = "wt", color = "qsec", size = "qsec"), | ||
geom = "point", | ||
scales = c("color_distiller", "size_continuous"), | ||
scales_args = list( | ||
color_distiller = list(palette = "Greens"), | ||
size_continuous = list(range = c(1, 20)) | ||
) | ||
) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.