Hi Leonardo, Thank you very much for the code. It works!
Initially I forgot to start the Rserve separately which results in c being null in line 80, this causes a null pointer exception. I noticed that the use of capture.output(cmd) to execute the input means that executing multiple commands in the same note requires the commands to be separated by a comma: %r a_vector <- rnorm(50,2), a_vector for example, but thinking about it that is no different than the r shell I suppose. It does make it a bit harder to paste the content of r script files into the note though. Not sure if using capture.output together with the source function and print.eval = TRUE would be a way to achieve that? Best regards Stefan > On 28 Sep 2015, at 11:48, Leonardo Foderaro <startrac...@gmail.com> wrote: > > Hi, > I've made a progress on the output issue. > now it's getting a lot closer to what you get when using R from console / > RStudio IDE. > > <Screen Shot 2015-09-28 at 12.41.22.png> > > just pushed the fix on my repo. > > thanks, > leo > > > > > > On Mon, Sep 28, 2015 at 10:30 AM, Leonardo Foderaro <startrac...@gmail.com > <mailto:startrac...@gmail.com>> wrote: > some snapshot: > > activating the Interpreter: > > <Screen Shot 2015-09-28 at 10.22.23.png> > > > at the moment a void expression like a function definition will produce an > "OK" string response: > > <Screen Shot 2015-09-28 at 10.21.40.png> > > > when using vector variables it returns the first element: > <Screen Shot 2015-09-28 at 10.26.05.png> > > I'll try to solve these (and a few other) issues as soon as I get some time > to spend on it. > > Thanks, > Leonardo > > > > > > > On Mon, Sep 28, 2015 at 10:17 AM, Leonardo Foderaro <startrac...@gmail.com > <mailto:startrac...@gmail.com>> wrote: > Hi, > I've just pushed to my repo my version of the RInterpreter: > > https://github.com/leonardofoderaro/incubator-zeppelin/tree/r-interpreter/R > <https://github.com/leonardofoderaro/incubator-zeppelin/tree/r-interpreter/R> > > it's a work in progress, I'm still working on the proper output format (e.g. > if the result of your expression is a vector actually you get only the first > element) and the plot support. > > it uses a Map<String, RConnection> to provide session isolation at notebook > level (the key of the Map is the nodebook id) > > I don't know if it's the right way to implement it (to avoid multiple > notebooks sharing and overwriting the same R variables), feel free to give it > a try and let me know if you think it's pointing in the right direction. > > thanks, > Leonardo > > > > > > > > > > > > On Mon, Sep 28, 2015 at 8:24 AM, Ashish Dalal <dalalstree...@gmail.com > <mailto:dalalstree...@gmail.com>> wrote: > Hi All, > Also, I tried the zeppelin-R repo provided by the datalayer.io > <http://datalayer.io/> folks but could not get it to working. I am also > facing the same issues as faced by Stefan. > > Regards, > Ashish > > On Mon, Sep 28, 2015 at 11:46 AM, Ashish Dalal <dalalstree...@gmail.com > <mailto:dalalstree...@gmail.com>> wrote: > Hi, Leonardo and Stefan, > > I have forked the following > https://github.com/elbamos/incubator-zeppelin/tree/rinterpreter/ > <https://github.com/elbamos/incubator-zeppelin/tree/rinterpreter/> and after > resolving some build issues , I was able to get R running successfully on my > local machine. I would be committing my code to my local repo in short while > from now. You can give it a try. > Also, Leonardo, I think for rendering R graphics inline on the zeppelin, you > got to install the repr package in R, now repr also is not a standard package > in R but you can it via the following command. > devtools::install_github("IRkernel/repr") > > Regards, > Ashish > > > On Mon, Sep 28, 2015 at 8:18 AM, Leonardo Foderaro <startrac...@gmail.com > <mailto:startrac...@gmail.com>> wrote: > Hi Stefan, > I am working on a similar task, an R Interpreter for Zeppelin. > Since I started from scratch my version is still quite essential (e.g. no > completion and no knitr yet) but I'm not getting your error. I can execute > multiple R paragraphs while keeping different Rserve sessions (one per > notebook) > On the other hand I'm facing some problems with graphics, I'd like to include > the beautiful R plotting capabilities in my Interpreter but (I still don't > know why) it isn't working yet. > However tomorrow I'll push my local repo so if you want you can give it a try > to see if it solves your run-and-restart issue. > > best regards, > Leonardo > > > > > > > On Sunday, September 27, 2015, Stefan Thorbjørn Blixen-Finecke > <stf...@gmail.com <mailto:stf...@gmail.com>> wrote: > Apologies if this has already been asked and answered. > > Is the best way to get an R interpreter in Zeppelin the guide below? > > https://github.com/datalayer/zeppelin-R > <https://github.com/datalayer/zeppelin-R> > > I’ve followed the instructions provided and set up an interpreter within > Zeppelin as pr. > https://zeppelin.incubator.apache.org/docs/development/writingzeppelininterpreter.html > > <https://zeppelin.incubator.apache.org/docs/development/writingzeppelininterpreter.html> > > However I can only run a command once successfully before the interpreter > fails (for the same command) with the following (from the log file): > > INFO [2015-09-27 20:11:27,856] ({pool-2-thread-2} > RInterpreter.java[interpret]:101) - Run R command 'R.version.string' > ERROR [2015-09-27 20:11:29,137] ({pool-2-thread-2} > RInterpreter.java[interpret]:130) - Exception while connecting to Rserve > org.rosuda.REngine.Rserve.RserveException: voidEval failed > at org.rosuda.REngine.Rserve.RConnection.voidEval(RConnection.java:209) > at io.datalayer.zeppelin.R.RInterpreter.interpret(RInterpreter.java:117) > > The interpreter has to be restarted from the zeppelin interpreter menu before > it can execute another command. Has anyone had any luck setting this up? If > yes, where any additional steps required? > > Best regards > Stefan > > > > >