On Tue, 9 Mar 2004, Susan Lin wrote:
> I have a problem to handle the following statements.
>
> for(i in [1:3])
> {
> file=paste("file", i, ".dat")
Don't you mean paste("file", i, ".dat", sep="") ? Or are your files
called `file 1 .dat'?
> bb <- read.table(file)
> x11()
> plot(bb)
> dev.off()
This opens a device, plots and closes it instantly. Is that what you
want? I would have had
par(ask=TRUE)
outside the loop, which will automatically launch as graphics device if
none is open.
>
> }
> When the input .dat file is empty, the program stops
> running and an error message appears. Could someone
> tell me how to handle this exception?
?try
--
Brian D. Ripley, [EMAIL PROTECTED]
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html