Zeppelin and R

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Zeppelin and R

Stefan Thorbjørn Blixen-Finecke
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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
Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Leonardo Foderaro
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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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
Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Ashish Dalal
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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

Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Ashish Dalal
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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


Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Leonardo Foderaro
Hi,
I've just pushed to my repo my version of the RInterpreter:


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 <[hidden email]> wrote:
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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



Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Leonardo Foderaro
some snapshot:

activating the Interpreter:




at the moment a void expression like a function definition will produce an "OK" string response:




when using vector variables it returns the first element:


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 <[hidden email]> wrote:
Hi,
I've just pushed to my repo my version of the RInterpreter:


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 <[hidden email]> wrote:
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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




Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Leonardo Foderaro
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.



just pushed the fix on my repo.

thanks,
leo





On Mon, Sep 28, 2015 at 10:30 AM, Leonardo Foderaro <[hidden email]> wrote:
some snapshot:

activating the Interpreter:




at the moment a void expression like a function definition will produce an "OK" string response:




when using vector variables it returns the first element:


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 <[hidden email]> wrote:
Hi,
I've just pushed to my repo my version of the RInterpreter:


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 <[hidden email]> wrote:
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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





Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Stefan Thorbjørn Blixen-Finecke
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
Hi,
I've just pushed to my repo my version of the RInterpreter:


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 <[hidden email]> wrote:
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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






Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Leonardo Foderaro
glad to know that my code is working not only on my machine lol

that's an interesting point about multiple R statements without the need of a separator, ideally it should work as close as possible to the plain R console.

also, since we're talking about implementation details probably we should better continue the discussion on dev@ instead of users@.

thanks,
leo


On Mon, Sep 28, 2015 at 10:12 PM, Stefan Thorbjørn Blixen-Finecke <[hidden email]> wrote:
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> wrote:
Hi,
I've just pushed to my repo my version of the RInterpreter:


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 <[hidden email]> wrote:
Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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







Reply | Threaded
Open this post in threaded view
|

Re: Zeppelin and R

Stefan Thorbjørn Blixen-Finecke
In reply to this post by Ashish Dalal
Hi Ashish,

Thank you for providing the r interpreter integration in the below repository and all your help with configuring it:


The integration of graphics output and SparkR works really well!

In case others find it helpful, setting it up required the following steps (for me at least, on OS X) which Ashish kindly guided me through:

Install the following R packages:

evaluate (required to compile the code in the repository)
devtools
ggtools2
googleVis
knitr
base64enc
htmltools

and repr,rCharts and devtools using:

library(devtools)
devtools::install_github("IRkernel/repr”)
devtools::install_github('apache/spark@v1.4.1', subdir='R/pkg’)
devtools::install_github('rCharts', 'ramnathv')

clone the repository and switch to the rinterpreter branch.

build using:

mvn clean package -DskipTests

and finally add org.apache.zeppelin.rinterpreter.RRepl,org.apache.zeppelin.rinterpreter.KnitR to the list of interpreters in the conf/zeppelin-site.xml file and start zeppelin - no need to create or copy any jars into interpreter/r.

the interpreter is then available as %spark.r.

Best regards
Stefan

On 28 Sep 2015, at 07:24, Ashish Dalal <[hidden email]> wrote:

Hi All,
Also, I tried the zeppelin-R repo provided by the 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 <[hidden email]> wrote:
Hi, Leonardo and Stefan,

I have forked the following 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 <[hidden email]> 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 <[hidden email]> wrote:
Apologies if this has already been asked and answered.

Is the best way to get an R interpreter in Zeppelin the guide below?


I’ve followed the instructions provided and set up an interpreter within Zeppelin as pr. 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