[R] how to use conditional statements to handle exceptions?

Susan Lin susan_lin99 at yahoo.com
Tue Mar 9 18:11:55 CET 2004


Hello,

I have a problem to handle the following statements.
  
  for(i in [1:3])
  {
    file=paste("file", i, ".dat")
    bb <- read.table(file)
    x11()
    plot(bb)
    dev.off()

  }
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?

Thanks




More information about the R-help mailing list