longContPlot | R Documentation |
This function creates a plot for longitudinal continuous data, optionally adding a random "jog" to each data point to reduce overplotting. It allows specifying the x and y limits and uses either provided or automatically calculated times for plotting.
longContPlot(y, times = NULL, jog = FALSE, ylim = NULL, xlim = NULL, ...)
y |
Numeric matrix of data to plot. |
times |
Optional; numeric vector or matrix of times corresponding to 'y' values. |
jog |
Logical; if TRUE, adds a random jog to the data to reduce overplotting. |
ylim |
Numeric vector; the range of y values to be plotted. |
xlim |
Numeric vector; the range of x values (times) to be plotted. |
... |
Additional arguments to be passed to the plot function. |
# longitudinal plot
times <- c(1,100,200,300,400,500)
par(mfrow=c(1,1), bg='cornsilk3')
longContPlot(example2cont, times, ylim=c(-2,6), main='', ylab='', xlab='Day')
par(mfrow=c(1,1), bg='transparent')
# jogging example
times <- c(1,100,200,300,400,500)
par(mfrow=c(1,2), bg='cornsilk3')
longContPlot(example2cat, times, ylim=c(0,6),
main='Growth Curves', ylab='', xlab='Days')
longContPlot(example2cat, times, jog=TRUE, ylim=c(0,6),
main='Growth Curves + Jogging',
ylab='', xlab='Days')
par(mfrow=c(1,1), bg='transparent')# compare growth curves to longCat
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.