search for: commandind

Displaying 1 result from an estimated 1 matches for "commandind".

Did you mean: commanding
2008 Jul 18
0
Rcpp from C++
...us; SEXP cmdSexp, cmdexpr, ans = R_NilValue; PROTECT(cmdSexp = Rf_allocVector(LANGSXP, 1)); char* cArr[4]; cArr[0] = "a <- seq(1,20)"; cArr[1] = "b <- seq(1,20)"; cArr[2] = "c <- a+ b"; cArr[3] = "print(c)"; for (int CommandInd = 0; CommandInd<4; CommandInd++) { PROTECT(cmdSexp = allocVector(STRSXP, 1)); SET_STRING_ELT(cmdSexp, 0, mkChar(cArr[CommandInd])); cmdexpr = PROTECT(R_ParseVector(cmdSexp, -1, &status, R_NilValue)); if (status != PARSE_OK) { UNPROTECT(2);...