Re: [R] Continue to finish for loop even there is an error in one of rounds.

2009-07-30 Thread Scott Sherrill-Mix
You probably want to wrap the nls(...) in a 'try' or 'tryCatch' function. Scott Scott Sherrill-Mix Department of Microbiology University of Pennsylvania 402B Johnson Pavilion 3610 Hamilton Walk Philadelphia, PA 19104-6076 Phone: 215-573-3141 On Thu, Jul 30, 2009 at 1:14 PM, Liao, Hongsheng

[R] Continue to finish for loop even there is an error in one of rounds.

2009-07-30 Thread Liao, Hongsheng
I am trying to fit a logistic model to my 10 year data (1999-2008) by year. Codes like below: Year <- c(1999: 2008) for(y in 1:length(year)) { file.input <- paste("C:\\", year[y], "\\data.csv", sep="") table <- read.csv(file=fileinput, header=TRUE, as.is=TRUE, na.strings=c("")) i