Vizualizing longitudinal data

plot_data(
  data,
  x_name = "age",
  y_name = "y",
  group_by = "id",
  facet_by = NULL,
  color_by = NULL,
  highlight = NULL,
  main = NULL,
  sub = NULL
)

Arguments

data

A data frame.

x_name

Name of x-axis variable.

y_name

Name of the y-axis variable.

group_by

Name of grouping variable (must be a factor).

facet_by

Name of the faceting variable (must be a factor).

color_by

Name of coloring variable (must be a factor).

highlight

Value of category of the group_by variable that is highlighted. Can only be used if color_by is NULL.

main

main plot title

sub

plot subtitle

Value

a ggplot object