not know your "LgmFormula". I think you already defined it.
Rao Fu
Ph.D
Yale University
Department of Statistics
Email: [EMAIL PROTECTED]
>>Date: Wed, 10 Sep 2008 15:22:37 +0200
>>From: "Benoit Boulinguiez" <[EMAIL PROTECTED]>
>>Subject: [R] writing
Benoit Boulinguiez ensc-rennes.fr> writes:
> yo<-function(Xdata)
> {
> n<-length(Xdata[,1])
>
> Lgm<-nls(formula=LgmFormula,
> data=Xdata,
> start=list(a=1500,b=0.1),weights=Xdata$Qe)
> return(Lgm)
> }
>
> After the execution of the script, when I call the function yo on data
> called NC60.
Its looking in environment(LgmFormula) for Xdata in order to evaluate
Xdata$Qe in the weights argument so just specify weights = Qe.
Alternately insert the following as the beginning of yo.
It creates a new local LgmFormula but with its environment set
to the current environment:
environment(L
Hi all,
I try to write a simple function in a script. The script is as follows
yo<-function(Xdata)
{
n<-length(Xdata[,1])
Lgm<-nls(formula=LgmFormula,
data=Xdata,
start=list(a=1500,b=0.1),weights=Xdata$Qe)
return(Lgm)
}
After the execution of the script, when I call the function yo on d
4 matches
Mail list logo