plot_long | R Documentation |
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
plot_long(
data,
x,
y,
by,
title,
xlab,
ylab,
xlow,
xhigh,
ylow,
yhigh,
color1,
color2 = color1,
percentile = 0,
show_max = FALSE,
span = 0.75
)
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 |
Plot
....
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.