See ?try or ?tryCatch. The basic idiom is given here:
https://stat.ethz.ch/pipermail/r-help/2005-May/072035.html
On 10/10/06, Warren [EMAIL PROTECTED] wrote:
Hi all,
I am trying to do fitting of large sets of timeseries data, and error
messages derail the process when I encounter a dataset that doesn't fit. I'd
like to ignore those misfits and try another equation or move to the next
dataset. Any ideas? (piece of code below)
Thanks,--Warren
##The code looks something like this:
attach(zf)
x - hours
n-length(zf[,2])
for (i in 2:n)
{y - zf[,i]
plot(y ~ x, xlab = Time (h), ylab = Lumi, pch = 15)
# fitting algorithm looks like this:
sine- nls (y ~ baseline + trend*x + amplitude*(sin(2*pi*(x+phase)/period)),
start=list(baseline=4000, amplitude=4000, phase=0, period=24, trend=0),
trace=TRUE)
...
}
--
Warren G. Lewis
[EMAIL PROTECTED]
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch 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.
__
R-help@stat.math.ethz.ch 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.