plotLongitudinal {growthPheno} | R Documentation |
Produces profile plots of longitudinal data for a set of individuals
Description
Produce profile plots of longitudinal data for a response using ggplot
.
A line is drawn for the data for each individual
and the plot
can be faceted so that a grid of plots is produced. For each facet a line for
the medians over time can be added, along with the vaue of the outer whiskers
(median +/- 1.5 * IQR).
Usage
plotLongitudinal(data, x = "xDays+44.5", response = "Area",
individuals = "Snapshot.ID.Tag", title = NULL,
x.title = "Days", y.title = "Area (kpixels)",
facet.x = ".", facet.y = ".",
labeller = NULL, colour = "black",
colour.column = NULL, colour.values = NULL,
alpha = 0.1, addMediansWhiskers = FALSE,
xname = "xDays", ggplotFuncs = NULL,
printPlot = TRUE)
Arguments
data |
A |
x |
A |
response |
A |
individuals |
A |
x.title |
Title for the x-axis. |
y.title |
Title for the y-axis. |
title |
Title for the plot. |
facet.x |
A |
facet.y |
A |
labeller |
A |
colour |
A |
colour.column |
A |
colour.values |
A |
alpha |
A |
addMediansWhiskers |
A |
xname |
A |
ggplotFuncs |
A |
printPlot |
A |
Value
An object of class "ggplot
", which can be plotted using
print
.
Author(s)
Chris Brien
See Also
ggplot
, labeller
.
Examples
data(exampleData)
plotLongitudinal(data = longi.dat, x = "xDAP", response = "sPSA")
plt <- plotLongitudinal(data = longi.dat, x = "xDAP", response = "sPSA",
x.title = "DAP", y.title = "sPSA (kpixels)",
facet.x = "Treatment.1", facet.y = "Smarthouse",
printPlot=FALSE)
plt <- plt + ggplot2::geom_vline(xintercept=29, linetype="longdash", size=1) +
ggplot2::scale_x_continuous(breaks=seq(28, 42, by=2)) +
ggplot2::scale_y_continuous(limits=c(0,750))
print(plt)
plotLongitudinal(data = longi.dat, x="xDAP", response = "sPSA",
x.title = "DAP", y.title = "sPSA (kpixels)",
facet.x = "Treatment.1", facet.y = "Smarthouse",
ggplotFuncs = list(ggplot2::geom_vline(xintercept=29,
linetype="longdash",
size=1),
ggplot2::scale_x_continuous(breaks=seq(28, 42,
by=2)),
ggplot2::scale_y_continuous(limits=c(0,750))))