[R] Superimposing graphs

Rmh rmh at temple.edu
Mon Aug 11 17:41:04 CEST 2014


whoops

P1<- plot(grouped.data)

Sent from my iPhone

> On Aug 11, 2014, at 5:06, Naser Jamil <jamilnaser79 at gmail.com> wrote:
> 
> Dear R-user,
> May I seek your help to sort out a little problem. I have the following
> codes
> to draw two graphs. I want to superimpose the second one on each of the
> first one.
> 
> ########################################
> 
> library(nlme)
> subject<-c(1,1,1,2,2,2,3,3,3)
> time<-c(0.0,5.4,21.0,0.0,5.4,21.0,0.0,5.4,21.0)
> con.cohort<-c(1.10971703,0.54535512,0.07176724,0.75912539,0.47825282,
> 0.10593292,1.20808375,0.47638394,0.02808967)
> 
> data.d=data.frame(subject=subject,time=time,conc=con.cohort)
> grouped.data<-groupedData(formula=conc~time | subject, data =data.d)
> 
> plot(grouped.data)
> 
> ##########################################
> 
> f1<-function(x,v,cl,t) {
> (x/v)*exp(-(cl/v)*t)
>                              }
> t<-seq(0,30, .01)
> plot(t,f1(0.5,0.5,0.06,t),type="l",pch=18, ylim=c(), xlab="time",
> ylab="conc")
> 
> 
> ###########################################
> 
> Any suggestion will really be helpful.
> 
> 
> Regards,
> 
> Jamil.
> 
>    [[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at 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.



More information about the R-help mailing list