Good morning!
Which is the preferred method to leave a sourced script and returning back to 
the '>' prompt?

For example I search for certain files to be processed, but nothing should be 
done if they
are not present. Normally I do in my script:
f<-dir(pattern="qq")
if(length(f) > 0) {
    ...process file list...
}
# script end

But I don't like those {} encompassing the whole script so I'm searching for 
something to
put in place of the '???' here:
f<-dir(pattern="qq")
if(length(f) == 0) '???'
...process file list...
# script end

Using stop("No file found", call.=F) works, but the Error message is ugly in 
this case.

Any suggestion?

Thanks for your help!
                        mario

-- 
Ing. Mario Valle
Data Analysis and Visualization Group            | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82

______________________________________________
R-help@r-project.org 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.

Reply via email to