Re: [R] How to skip rest of code

2009-05-04 Thread bartjoosen
How about: x <- F if (x) { print("true") } else { print("false") } Bart mli-2 wrote: > > Dear R users, > > Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file > 'main.R' which sources each of them. I wonder if there is a way to skip > rest of code in 'test1.R' once a

Re: [R] How to skip rest of code

2009-04-30 Thread jim holtman
?try see if: try(source('file')) works when you use 'stop()' instead of 'q()' in your example. On Thu, Apr 30, 2009 at 10:24 AM, Ming-Chung Li wrote: > Dear R users, > > Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file > 'main.R' which sources each of them. I wonder if

[R] How to skip rest of code

2009-04-30 Thread Ming-Chung Li
Dear R users, Suppose I have 2 R script files: 'test1.R' and 'test2.R' and one R file 'main.R' which sources each of them. I wonder if there is a way to skip rest of code in 'test1.R' once a condition is met but still continue to run rest of script from the 'main'R' file. A simple example is