metan (version 1.2.1)

plot_factlines: Fast way to create a line plot

Description

Create a graphic to show a fitted line based on numerical variables and one grouping variable.

Usage

plot_factlines(
  .data,
  x,
  y,
  group,
  fit,
  level = 0.95,
  confidence = TRUE,
  xlab = NULL,
  ylab = NULL,
  legend.position = "bottom",
  grid = FALSE,
  scales = "free",
  col = TRUE,
  alpha = 0.2,
  size.shape = 1.5,
  size.line = 1,
  size.text = 12,
  fontfam = "sans",
  plot_theme = theme_metan()
)

Arguments

.data

The data set

x

The variable in data to be shown in the x axis

y

The variable in data to be shown in the y axis

group

The grouping variable

fit

The polynomial degree to use. It must be an integer between 1 (linear fit) to 4 (fourth-order polynomial regression.), or a numeric vector with the same length of the variable in group

level

The fonfidence level

confidence

Display confidence interval around smooth? (TRUE by default)

xlab

The x label

ylab

The y label

legend.position

The position of the legend. Defaults to 'bottom'.

grid

Logical argument. If TRUE then a grid will be created.

scales

If grid = TRUE scales controls how the scales are in the plot. Possible values are 'free' (default), 'fixed', 'free_x' or 'free_y'.

col

The colour to be used in the line plot and points

alpha

The alpha for the color in confidence band

size.shape

The size for the shape in plot

size.line

The size for the line in the plot

size.text

The size of the text

fontfam

The family of the font text

plot_theme

The graphical theme of the plot. Default is plot_theme = theme_metan(). For more details, see theme.

Value

An object of class gg, ggplot.

See Also

plot_lines, plot_factbars