I'm Indeed grateful! The code did a perfect job.
 
regards.


--- On Sun, 10/5/08, Jim Lemon <jim@bitwrit.com.au> wrote:

From: Jim Lemon <jim@bitwrit.com.au>
Subject: Re: [R] Shadowed Plot
To: segun300l@yahoo.com
Cc: R-help@r-project.org
Date: Sunday, October 5, 2008, 3:31 AM

segun ogundimu wrote:
> Hello R-users
>  
>  
> Kindly assist me with the following plot problem in R-
> My data looks like this (shortened because I have about 5000
observations).
>  
> dat <- read.table(textConnection("Id  Time Y      
> 1 0   194
> 1 5.22 179
> 1 5.97 190 
> 2 1.61 265 
> 2 2.1  234
> 2 16.4 300 
> 2 29.5 345 
> 3 0    212
> 3 0.36 213 
> 4 0    199
> 4 1.23  203
> 5  0   212
> 5  13.5 216
> 6  0    222
> 6  1.6 234" ), header = TRUE)
> closeAllConnections()
>  
> The measurements are not taken at equal time points.  I want to avoid
overly cluttered plots in making individual profile. So, I will like the profile
plot to appear grey (not completely visible) and about 30 randomly selected
'lucky subjects' to appear dark(very visible).
>   
Hi segun,
Will this do the job?

luckyones<-sample(unique(dat$Id),3)
plot(dat$Time,dat$Y,type="n",main="The luck of the
drawing",)
for(subid in unique(dat$Id))
 lines(dat$Time[dat$Id == subid],dat$Y[dat$Id == subid],
 col=ifelse(subid %in% luckyones,"black","lightgray"))

Jim




      
	[[alternative HTML version deleted]]

