[R] function

ctu at bigred.unl.edu ctu at bigred.unl.edu
Sun Jun 1 08:10:27 CEST 2008


I wrote a function and I hope this helps
b<-c(1,2,3,4);lambda<-c(0.3,0.4,0.5,0.6)
m<-c(0.10,0.11,0.12,0.13);t<-c(7,8,9,10)
N=4
Y<-matrix(data=NA,nrow=4, ncol=1)
for (i in 1:N){
     y=b*(1-exp(lambda*(t^m)))
     Y<-matrix(data=y, nrow=4, ncol=1)
     Y<-as.numeric(Y)
     sim<-data.frame(t, Y);plot(sim,xlab="age", ylab="response", col="red")
}

Chunhao

Quoting admin <dahman31 at gmail.com>:

> hi i have to make my function
> y=b*(1-exp(lambda*(t^m))
> and my data are in excel file with names:
> Year /b/lambda/m
> and t is an age in another file calls pcb
> could u help me please to calculate all y for all years please
> i can make this step by step but i want an program for having all y and plot
> them in the same windows with legend could u help me please thank u
>
> 	[[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