plot_line.RdWrapper around [ggplot2::geom_line()] that plots pretty line plots using a custom ggplot theme.
plot_line(
data,
x_str,
y_str,
color_str = NULL,
theme_options = NULL,
show_plot = FALSE,
...
)Data frame to use for plot.
Character string. Name of variable in data to plot on
x-axis.
Character string. Name of variable in data to plot on
y-axis.
Character string (optional). Name of variable in data
to use as color aesthetic in plot.
(Optional) list of arguments to pass to vthemes::theme_vmodern().
Logical. Should this plot be printed? Default FALSE.
Other arguments to pass to [ggplot2::geom_line()].
A ggplot line plot.
Other pretty_ggplot_wrappers:
plot_bar(),
plot_boxplot(),
plot_density(),
plot_histogram(),
plot_point()
df <- data.frame(time = 1:5, value = 5:9)
plot_line(df, x_str = "time", y_str = "value")
df2 <- data.frame(time = rep(1:5, 2), value = 1:10,
group = rep(letters[1:2], each = 5))
plot_line(df2, x_str = "time", y_str = "value", color_str = "group")