plot_mm {packHV} | R Documentation |
Spaghetti plot and plot of the mean at each time
Description
Spaghetti plot and plot of the mean at each time
Usage
plot_mm(formula, data, col.spag = 1, col.mean = 1,
type = "spaghettis", tick.times = TRUE, xlab = NULL, ylab = NULL,
main = "", lwd.spag = 1, lwd.mean = 4, ...)
Arguments
formula |
|
data |
data frame in which we can find |
col.spag |
vector of length |
col.mean |
vector of length |
type |
|
tick.times |
boolean, |
xlab |
character sring, label of the time axis |
ylab |
character string, label of the y axis |
main |
character string, main title |
lwd.spag |
numeric, width of the spaghetti lines, 1 by default |
lwd.mean |
numeric, width of the mean lines, 4 by default |
... |
Other arguments to be passed in |
Value
None
Author(s)
Hugo Varet on Anais Charles-Nelson's idea
Examples
N=10
time=rep(1:4,N)
obs=1.1*time + rep(0:1,each=2*N) + rnorm(4*N)
my.data=data.frame(id=rep(1:N,each=4),time,obs,group=rep(1:2,each=N*2))
par(xaxs="i",yaxs="i")
plot_mm(obs~time+(group|id),my.data,col.spag=my.data$group,
col.mean=c("blue","red"),type="both",main="Test plot_mm")
[Package packHV version 2.2 Index]