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 ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.