An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090129/55a6f70d/attachment-0001.pl>
Help
3 messages · Alexandra Almeida, patricia garcía gonzález, rkevinburton at charter.net
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090129/c333198b/attachment-0001.pl>
You could look into ' try' and set it up to catch errors and do the appropriate thing in your error handler. I don't have the exact syntax at hand right now but looking at ?try or ?tryCatch I think will do what you want. Kevin
---- Alexandra Almeida <alexandrarma at gmail.com> wrote:
Hi everybody!
I?m with a problem that probably is easy for you, but I really don?t know
how to solve.
On the following script:
for(j in 1:length(limiares))
{
excessos<-limiares[j]-estacao[estacao<limiares[j]]
par.ests<-gpd(-(estacao),threshold=-limiares[j],method=c("pwm"))$par.est
GOF.test<-ks.test(excessos,"pgpd",xi=par.ests[1],beta=par.ests[2])$p.value
tabs[j,]<-c(par.ests,gpd(-(estacao),threshold=-limiares[j],method=c("pwm"))$par.ses,GOF.test,length(excessos))
}
I?ve found the error for some values of i: Erro em ks.test(excessos, "pgpd",
xi = par.ests[1], beta = par.ests[2]) : NA/NaN/Inf em chamada de fun??o
externa (argumento 1)
*My question is: This warning stop the "for" and I don?t want it, is there
some way to continue the "for", and for the cases where the function cannot
calculate the ks.test for the i just leave a NA as answer???*
Thank you *very much*!!!
Alexandra Almeida
--
Alexandra R M de Almeida
[[alternative HTML version deleted]]