c++ - Error while compiling RInside code -


i want compile r code using rinside. getting errors while using function read.csv. code snippet given below:

include "rinside.h" include <iomanip>   include <iostream>   include <fstream>   include <string>     include <vector>    include <sstream>     using namespace std;  int main(int argc,char*argv[]) {     rinside r(argc,argv);    sexp ans;    r.parseevalq("library(plotrix)");    r.parseevalq("filecontents<-read.csv("/home/nibha/manoj/test.csv")");    r.parseevalq("nr <-nrow (filecontents)");    r.parseevalq("nc <-ncol (filecontents)");   }   

i getting errors follows:

: in function ‘int main(int, char**)’:   prog3.cpp:14: error: ‘home’ not declared in scope   prog3.cpp:14: error: ‘nibha’ not declared in scope   prog3.cpp:14: error: ‘manoj’ not declared in scope   prog3.cpp:14: error: ‘test’ not declared in scope   prog3.cpp:20: error: ‘myfile’ not declared in scope   

you have double quote " inside double-quoted string

r.parseevalq("filecontents<-read.csv("/home/nibha/manoj/test.csv")");  

so, escape backslash \, , try again.

r.parseevalq("filecontents<-read.csv(\"/home/nibha/manoj/test.csv\")");  

Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -