fast_plot: Creates either scatter plot, line plot or bar chart using two...

Description Usage Arguments Value Examples

View source: R/fast_plot.R

Description

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

Usage

1
fast_plot(df, x, y, plot_type)

Arguments

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

Value

ggplot object

Examples

1
fast_plot(iris, "Sepal.Length", "Sepal.Width", "scatter")

UBC-MDS/redahelper documentation built on April 2, 2020, 3:59 a.m.