[R] Odp: R code
petr.pikal at precheza.cz
Thu Dec 1 10:48:55 CET 2011
> Hi everybody,
> I am unable to resolve this error using the following for loop. Would
> appreciate help. The same loop works with for(i in 1:92) strangely. I
> checked the .raw input file and everything is kosher, even Line 547
> mentioned in the error message.
> I wonder if there is any problem with the paste function.
I do not believe it. In that case the message will be, that R can not open
You speak about input file but actually you are reading 93 files. Which
one is wrong? Did you check that one? And how did you checked it?
There could be some unseen characters in this row. Without some more info
I doubt you get any better advice.
> Thanks very much in advance.
> for(i in 1:93)
> inputdta<- read.table(file=gsub(" ","",paste("JSR_network_[",i,"].RAW"),
> fixed=TRUE), header=TRUE)
> colnames(inputdta) <- c("jsrid","firmid","jsrstart","injsr")
> Message: Error in scan(file, what, nmax, sep, dec, quote, skip, nlines,
> na.strings, : line 547 did not have 4 elements
> View this message in context: http://r.789695.n4.nabble.com/R-code-
> Sent from the R help mailing list archive at Nabble.com.
> [[alternative HTML version deleted]]
> R-help at r-project.org mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help