In R 0.60.1 when I source a fairly large file of code I am getting: Error in parse(file, n, text, prompt) : syntax error on line 2985 I don't see any error and it doesn't happen if I split the file in two pieces. increasing -v -n does not seem to help and does not change the location of the error. Does anyone have suggestions? Paul Gilbert -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>>>>> Paul Gilbert writes:> In R 0.60.1 when I source a fairly large file of code I am getting: > Error in parse(file, n, text, prompt) : syntax error on line 2985> I don't see any error and it doesn't happen if I split the file in two > pieces. increasing -v -n does not seem to help and does not change > the location of the error. Does anyone have suggestions?Two suggestions: * Does the problem occur at the end of the file? Then, the problem might be a final newline ... * Does the file contain ASCII 0 characters? -k -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
I have narrowed my problem with parse to the example below. This is not a working piece of code, but does cause the source problem. (This also occurs with R 0.61.) The code will cut and paste into R ok, but if I cut and paste into a file and source the file I get Error in parse(file, n, text, prompt) : syntax error on line 23 Relatively minor things like changing } } } } to } } } } will make the problem go away. (So I guess I know a solution, but it seems like there is a bug.) Paul Gilbert ________ ARMA <- function(model) { if (0 !=m) if (p != dim(C)[2]) stop("dimension of model parameters do not conform!") if (fortran) if (m==0) C <- array(0,c(1,p,1)) else {for (Time in 1:sampleT) {if (b >= 2) for (l in 2:b) if (l<=Time) vt <- vt - c(B[l,,] %*% prederror[Time+1-l,]) if (m!=0) for (l in 1:dim(C)[1]) if (l<=Time) vt <- vt - c(C[l,,] %*% u[Time+1-l,]) prederror[Time,] <- vt if (any(0!=error.weights)) { if (length(error.weights)>1) {for (h in 2:length(error.weights)) if ( (Time+h-1) <= sampleT) {vt <- rep(0,p) } } } } } 1 } KF <- function(model) {2} -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._