gghelp: Converts a natural language query into a 'ggplot2' command.

View source: R/ggx.R

gghelpR Documentation

Converts a natural language query into a 'ggplot2' command.

Description

Converts a natural language query into a 'ggplot2' command string. Queries should be related to the styling of the plot, such as, axis label font size, axis label title, legend, and similar.

Usage

gghelp(query = "", print = TRUE)

Arguments

query

Character. A natural language command related to the styling of a ggplot.

print

Boolean. Print out the command or just return it.

Details

'gghelp' 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 as string.

Value

Returns a string if there is a matching ggplot command in the database. Otherwise returns NULL.

See Also

gg_

Examples


gghelp("rotate x-axis labels by 90 degrees")

gghelp("increase font size on x-axis label")

gghelp("set x-axis label to 'Length of Sepal'")



brandmaier/ggx documentation built on Oct. 28, 2022, 11:24 p.m.