john james
2008-Aug-11 08:25 UTC
[R] Making shadowed plot of individual profile from Longitudinal data
Dear R-help, I have a longitudinal dataset with about 5,000 subjects. To avoid overly cluttered plot of the individual profile, I want the plot to be shadowed and to randomly select say 100 subjects which will be depicted using darker lines on the plot. Kindly guide me through on how to do this in R. regards John [[alternative HTML version deleted]]
Jim Lemon
2008-Aug-12 11:46 UTC
[R] Making shadowed plot of individual profile from Longitudinal data
On Mon, 2008-08-11 at 01:25 -0700, john james wrote:> Dear R-help, > > I have a longitudinal dataset with about 5,000 subjects. To avoid overly cluttered plot of the individual profile, I want the plot to be shadowed and to randomly select say 100 subjects which will be depicted using darker lines on the plot. > > Kindly guide me through onhow to do this in R. >Hi John, Depends upon what you mean by "shadowed". I'll assume that you want the 4900 unlucky subjects to be displayed with minimal visibility and the lucky 100 with maximal visibility. Assume your data matrix is named "mymat". luckyones<-sample(1:5000,100) matplot(mymat[,-luckyones],type="l",col="lightgray",...) matlines(mymat[,luckyones],col=1) Jim