PrintValue(mkString("Parsing error :=>"));
sprintf(cmd,"syntax error on line %d ",R_ParseError);
PrintValue(e);
if (TYPEOF(e) == EXPRSXP) {
e = eval(VECTOR_ELT(e, 0), R_GlobalEnv);
PrintValue(e);
}
This function returns SEXP and status of parse. It does not return any parse Error messages .
I have modified the R code , added a new function R_throwError() which will return the private variable R_ParseErrorMsg for parsing error. I am wondering If this part can be added to R code .
It is useful for people who call libR from C. Some time the errors are hard to find in a big file.The error message will provide line number , position of error and error message.
Hi ,
I have developed a project which utilizes R from C . We are calling libR and follow the instruction :
PROTECT(tmp = mkString(prog)); PROTECT(e = R_ParseVector(tmp, -1, &status,R_NilValue)); if (status != PARSE_OK) {
This function returns SEXP and status of parse. It does not return any parse Error messages .
I have modified the R code , added a new function R_throwError() which will return the private variable R_ParseErrorMsg for parsing error. I am wondering If this part can be added to R code .
It is useful for people who call libR from C. Some time the errors are hard to find in a big file.The error message will provide line number , position of error and error message.
Please let me know.
Thanks, Sandip
METADATA