Description Usage Arguments Value Examples
The function takes in a dataframe, two column names for x and y axis and a plot type and creates the plot using the ggplot2 library. The plot types are restricted to either line plot, scatter plot or bar chart. The function includes error handling to stop plots from being created for inappropriate column types, such as a scatter plot will not be appropriate if both columns have categorical types
1 |
df |
The data that will be plotted |
x |
The column name for the x variable |
y |
The column name for the y variable |
plot_type |
The type of plot from: scatter, line, bar |
ggplot object
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.