gg_ | R Documentation |
Converts a natural language query into a 'gg' object, which can be directly chained to a 'ggplot'-call. Queries should be related to the styling of the plot, such as, axis label font size, axis label title, legend, and similar.
gg_(query = NULL)
query |
Character. A natural language command related to the styling of a ggplot. |
'gg_' calls the function 'gghelp', which maintains a database of keywords that match typical queries related to styling 'ggplot2' graphs. Based on the users natural language query, the function tries to find the best match and then returns the ggplot2 command, such that the result of a call to 'gg_' can be chained directly to a 'ggplot()' call.
An object of class 'gg' from the internal class system of 'ggplot2'
gghelp
## Not run: library(ggplot2) ggplot(data=iris, mapping=aes(x=Sepal.Length, y=Petal.Length, color=Species))+ geom_point()+ gg_("rotate x-axis labels by 90°")+ gg_("set x-axis label to 'Length of Sepal'") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.