[R] What is wrong with this code?

Cable, Samuel B Civ USAF AFMC AFRL/RVBXI Samuel.Cable at hanscom.af.mil
Wed Jun 30 21:41:00 CEST 2010


OK, let me wipe the egg off of my face .... The problem wasn't with the
break statement, it was with how I had included my functions in the
"input.list" list.  I promise, I pounded on this for hours and saw the
problem five minutes after I sent off the e-mail.  Anybody else ever
have this happen?

Anyway, I still wouldn't mind some advice on character matching.
Thanks.

> 
> Cable, Samuel B Civ USAF AFMC AFRL/RVBXI wrote:
> > Here it is:
> >
> > read.inputs<-function(infile) {
> >
> >    for (counter in 1:length(input.list)) {
> >       seek(infile,where=0,origin='start')
> >       newline<-readLines(infile,n=1)
> >       while(length(newline)>0) {
> >
> > if(!is.na(grep(as.character(input.list[[counter]][1]),newline)[1]))
{
> >           break
> >         }
> >         newline<-readLines(infile,n=1)
> >       }
> >       if (length(newline)>0) input.list[[counter]][2](infile)
> >    }
> >
> > }



More information about the R-help mailing list