mk_facet_lineplot: Create a function for making publishable ggplot2 faceted...

View source: R/mk_facet_lineplot.R

mk_facet_lineplotR Documentation

Create a function for making publishable ggplot2 faceted plot.

Description

mk_facet_lineplot takes a data frame as input and returns a function for making faceted plots that can display relationship of upto 5 variables at one time.

Usage

mk_facet_lineplot(df)

Arguments

df

A data frame.

Value

function(xvar, yvar, xvar_top, yvar_rt, colorby = "1", ylab_rt = NULL, palette = "D", linew = 0.7, legend_title = colorby, legend_pos = "right", font_size = 14)

  • xvar. String, name of a continuous var for the bottom x-axis.

  • yvar. String, name of a continuous var for the left y-axis.

  • xvar_top. String, name of a categorical var for the top x-axis.

  • yvar_rt. String, name of a continuous var for the right y-axis.

  • colorby. String, name of a continuous or categorical variable for coloring the curves. Default = "1", meaning no such variable is supplied.

  • ylab_rt. String, 2nd y-axis label. If NULL (default), use the value of yvar_rt.

  • palette. String, the colormap option to use. Possible values are "A", "B", "C", "D" (default) and "E".

  • linew. Number, width of the line. Default = 0.7.

  • legend_title. String, legend title. Default is the name of the colorby variable.

  • legend_pos. String, legend position. Default = "right".

  • font_size. Overall font size. Default = 14. The font size of the axes and legend text is a fraction of this value.

Examples

inst/examples/ex-mk_facet_lineplot.R

gmlang/ezplot documentation built on Sept. 18, 2022, 6:33 a.m.