plot_long: Plot to show longitudinal data

View source: R/plot_long.R

plot_longR Documentation

Plot to show longitudinal data

Description

Function takes in data, and plots points and lines longitudinally, using loess (you can change span, but it is set to default) You can also choose to show the local maximum for analytical purposes

Usage

plot_long(
  data,
  x,
  y,
  by,
  title,
  xlab,
  ylab,
  xlow,
  xhigh,
  ylow,
  yhigh,
  color1,
  color2 = color1,
  percentile = 0,
  show_max = FALSE,
  span = 0.75
)

Arguments

data

- data set from which we plot

x

- what is on the x-axis

y

- what is on the y-axis

by

- data groupings we choose (different coloured, different calculations) - example - plotting bodyweight over mouse age, grouping by strain to see how different strains tend to gain or lose weight over time

title

- this is the title of your plot. This parameter is optional

xlab

- this is the x-axis label. This parameter is optional

ylab

- this is the y-axis label. This parameter is optional

xlow

- lower bound on the x-axis. This parameter is optional, and if you skip it, it will recalculate based on data

xhigh

- upper bound on the x-axis. This parameter is optional, and if you skip it, it will recalculate based on data

ylow

- lower bound on the y-axis. This parameter is optional, and if you skip it, it will recalculate based on data

yhigh

- upper bound on the y-axis. This parameter is optional, and if you skip it, it will recalculate based on data

color1

- palette you want to use. This is optional - if you don't set it, r will use default pallette

color2

- if you want a different color for the lines than the points, indicate it here, otherwise it is the same as color1 by default

percentile

- this refers to which points you don't want to plot. For example, if it is set to 0.05, meaning that 5 points don't get plotted. Default is 0, so no points get removed

show_max

- this asks if you want to put a line through local maximum of y. Default is FALSE

span

- this refers to span for LOESS lines. Default is set to r defalut, which is 0.75

Value

Plot

Author(s)

....


wfmueller29/SLAM documentation built on April 5, 2025, 5:09 a.m.