Re: [R] Query about using try block

2007-01-22 Thread lalitha viswanath
Hi Thanks for your response. However I seem to be doing something wrong regarding the try block resulting in yet another error described below. I have a function that takes in a file name and does the fit for the data in that file. Hence based on your input, I tried try ( (fit = lm(y~x, data =

Re: [R] Query about using try block

2007-01-22 Thread talepanda
Usually (that is, not limited in R language), when error occurs in try, stacks are rollbacked, so the variables defined in try no longer exists after calling try. One non-elegant solution is: fit-NULL try ( (fit = lm(y~x, data = data_fitting)), silent =T) if(!is.null(fit)){ coeffs =