[R] fatal error prevents multi-line functions or loop to run

2012-04-02 Thread Ebrahim Jahanshiri
Dear all, I have written some function that can go up to many lines. Two of the lines give warning errors like: Error in print()[c(1, : error in evaluating the argument 'x' in selecting a method for function 'print': Error in ... regions with no neighbours found now obviously this

Re: [R] fatal error prevents multi-line functions or loop to run

2012-04-02 Thread Jeff Newmiller
Sounds like you tried everything I know. However, I, and anyone else on this list whose mind-reading powers are undeveloped, really can't be sure because you didn't show us what you tried. Perhaps you should (re-)read the posting guidelines and try showing us reproducible sample code that

Re: [R] fatal error prevents multi-line functions or loop to run

2012-04-02 Thread Ebrahim Jahanshiri
Thanks jeff, You are right about my expectation so if you have time please take a look at this: library(spdep) test - function () { #read neighborhood list neigh.gal - read.gal( http://sites.google.com/site/geosciej/Home/ter1RIorigM_T1.GAL?revision=1;) #Making a weight matrix (listW) w -

Re: [R] fatal error prevents multi-line functions or loop to run

2012-04-02 Thread Jeff Newmiller
Since you want to progress to further statements within test(), you need to wrap the summary function call in the try, not the whole test() function: try( summary(w), silent =TRUE ) --- Jeff Newmiller