RCall example

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
22 messages Options
12
Reply | Threaded
Open this post in threaded view
|

RCall example

David Anthoff

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Stefan Karpinski
I've found that the tests are the best examples at the moment (this is often the case):


On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Andreas Noack
Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

I was able to make a plot with

julia> x = randn(100);

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

julia> @rput df;

julia> @rlibrary ggplot2

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))
RCall.RObject{RCall.VecSxp}


On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:
I've found that the tests are the best examples at the moment (this is often the case):


On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Simon Byrne
Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

My recommendation would be to use the R"" string macro:

julia> R"library(ggplot2)";


julia> R"qplot(x, y, data = $df, colour = factor(tp))"


-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:
Also, take a look here <a href="http://juliastats.github.io/RCall.jl/latest/lib/public/#methods" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Flib%2Fpublic%2F%23methods\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxsTvfU5Jyya5ECq45QdRgHqXq6A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Flib%2Fpublic%2F%23methods\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxsTvfU5Jyya5ECq45QdRgHqXq6A&#39;;return true;">http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

I was able to make a plot with

julia> x = randn(100);

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

julia> @rput df;

julia> @rlibrary ggplot2

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))
RCall.RObject{RCall.VecSxp}


On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="aYGW5gceIQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ste...@...> wrote:
I've found that the tests are the best examples at the moment (this is often the case):

<a href="https://github.com/JuliaStats/RCall.jl/blob/master/test/basic.jl" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJuliaStats%2FRCall.jl%2Fblob%2Fmaster%2Ftest%2Fbasic.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHVZ2uWvz4L_7ei8Gp-W5gs_M4jUw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJuliaStats%2FRCall.jl%2Fblob%2Fmaster%2Ftest%2Fbasic.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHVZ2uWvz4L_7ei8Gp-W5gs_M4jUw&#39;;return true;">https://github.com/JuliaStats/RCall.jl/blob/master/test/basic.jl

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="aYGW5gceIQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">ant...@...> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

<a href="http://www.david-anthoff.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;">http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aYGW5gceIQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="aYGW5gceIQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Douglas Bates
On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:
Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

My recommendation would be to use the R"" string macro:

julia> R"library(ggplot2)";


julia> R"qplot(x, y, data = $df, colour = factor(tp))"


Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

R"""
  # write R code here
"""

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.
 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:
Also, take a look here <a href="http://juliastats.github.io/RCall.jl/latest/lib/public/#methods" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Flib%2Fpublic%2F%23methods\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxsTvfU5Jyya5ECq45QdRgHqXq6A&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjuliastats.github.io%2FRCall.jl%2Flatest%2Flib%2Fpublic%2F%23methods\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxsTvfU5Jyya5ECq45QdRgHqXq6A&#39;;return true;">http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

I was able to make a plot with

julia> x = randn(100);

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

julia> @rput df;

julia> @rlibrary ggplot2

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))
RCall.RObject{RCall.VecSxp}


On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:
I've found that the tests are the best examples at the moment (this is often the case):

<a href="https://github.com/JuliaStats/RCall.jl/blob/master/test/basic.jl" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJuliaStats%2FRCall.jl%2Fblob%2Fmaster%2Ftest%2Fbasic.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHVZ2uWvz4L_7ei8Gp-W5gs_M4jUw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2FJuliaStats%2FRCall.jl%2Fblob%2Fmaster%2Ftest%2Fbasic.jl\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHVZ2uWvz4L_7ei8Gp-W5gs_M4jUw&#39;;return true;">https://github.com/JuliaStats/RCall.jl/blob/master/test/basic.jl

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

<a href="http://www.david-anthoff.com" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;">http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-stats...@googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: RCall example

David Anthoff

This is absolutely fantastic, what a hidden gem!

 

This might also be the best way to produce high quality graphs from julia at the moment, right?

 

I feel this whole approach should be made much more well known, I think many more people would be willing to use julia for their day-to-day work if they knew that they could easily use e.g. ggplot2 for plotting, and things like dplyr for data transformation etc.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Douglas Bates
Sent: Thursday, April 28, 2016 9:48 AM
To: julia-stats <[hidden email]>
Subject: Re: [julia-stats] RCall example

 

On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:

Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

 

My recommendation would be to use the R"" string macro:

 

julia> R"library(ggplot2)";

 

julia> R"qplot(x, y, data = $df, colour = factor(tp))"

 

Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

 

R"""

  # write R code here

"""

 

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.

 

 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:

Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

 

I was able to make a plot with

 

julia> x = randn(100);

 

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

 

julia> @rput df;

 

julia> @rlibrary ggplot2

 

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))

RCall.RObject{RCall.VecSxp}

 

 

On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:

I've found that the tests are the best examples at the moment (this is often the case):

 

 

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Michael Borregaard
There are many ways to produce high-quality graphs from Julia at the moment. Check out for example PlotlyJS.jl , which offers offline plotly capability in Julia (i.e. not using the online plotly service).

On Thu, Apr 28, 2016 at 7:37 PM, David Anthoff <[hidden email]> wrote:

This is absolutely fantastic, what a hidden gem!

 

This might also be the best way to produce high quality graphs from julia at the moment, right?

 

I feel this whole approach should be made much more well known, I think many more people would be willing to use julia for their day-to-day work if they knew that they could easily use e.g. ggplot2 for plotting, and things like dplyr for data transformation etc.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Douglas Bates
Sent: Thursday, April 28, 2016 9:48 AM
To: julia-stats <[hidden email]>
Subject: Re: [julia-stats] RCall example

 

On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:

Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

 

My recommendation would be to use the R"" string macro:

 

julia> R"library(ggplot2)";

 

julia> R"qplot(x, y, data = $df, colour = factor(tp))"

 

Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

 

R"""

  # write R code here

"""

 

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.

 

 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:

Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

 

I was able to make a plot with

 

julia> x = randn(100);

 

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

 

julia> @rput df;

 

julia> @rlibrary ggplot2

 

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))

RCall.RObject{RCall.VecSxp}

 

 

On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:

I've found that the tests are the best examples at the moment (this is often the case):

 

 

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Michael Borregaard
If I may ask, purely out of curiosity, which functionality from dplyr are you missing from DataFramesMeta?

On Thu, Apr 28, 2016 at 7:53 PM, Michael Krabbe Borregaard <[hidden email]> wrote:
There are many ways to produce high-quality graphs from Julia at the moment. Check out for example PlotlyJS.jl , which offers offline plotly capability in Julia (i.e. not using the online plotly service).

On Thu, Apr 28, 2016 at 7:37 PM, David Anthoff <[hidden email]> wrote:

This is absolutely fantastic, what a hidden gem!

 

This might also be the best way to produce high quality graphs from julia at the moment, right?

 

I feel this whole approach should be made much more well known, I think many more people would be willing to use julia for their day-to-day work if they knew that they could easily use e.g. ggplot2 for plotting, and things like dplyr for data transformation etc.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Douglas Bates
Sent: Thursday, April 28, 2016 9:48 AM
To: julia-stats <[hidden email]>
Subject: Re: [julia-stats] RCall example

 

On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:

Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

 

My recommendation would be to use the R"" string macro:

 

julia> R"library(ggplot2)";

 

julia> R"qplot(x, y, data = $df, colour = factor(tp))"

 

Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

 

R"""

  # write R code here

"""

 

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.

 

 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:

Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

 

I was able to make a plot with

 

julia> x = randn(100);

 

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

 

julia> @rput df;

 

julia> @rlibrary ggplot2

 

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))

RCall.RObject{RCall.VecSxp}

 

 

On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:

I've found that the tests are the best examples at the moment (this is often the case):

 

 

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: RCall example

David Anthoff
In reply to this post by Michael Borregaard

Yeah, I really like the work on PlotlyJS.jl.

 

Having said that, at this point I see a whole bunch of really good things about using ggplot2 via RCall:

- There are a gazillion examples, tutorials etc. out there on the web on how to create any type of graph imaginable. Makes it much more approachable for many users.

- It has a grammar of graphics API. Many people really like that. The only other julia package that seems to support that is Gadfly (but that seems to have vastly less features than ggplot2).

- It is stable. They have released a 1.0, so most likely my plotting code will still work in half a year. Many of the julia plotting packages right now seem under pretty heavy dev.

- Generally transferability of skills. There are probably a couple hundred thousand people out there that know how to use ggplot2, if they can all bring that knowledge across to julia with so little effort, it seems a major positive that we as the julia community might to highlight.

 

I’m not at all saying that I don’t like the more homegrown plotting approaches in julia, but at this point ggplot2 seems just way, way more mature, and at least I was really surprised today how super simple it is to use it from within julia.

 

Cheers,

David

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Krabbe Borregaard
Sent: Thursday, April 28, 2016 10:53 AM
To: [hidden email]
Subject: Re: [julia-stats] RCall example

 

There are many ways to produce high-quality graphs from Julia at the moment. Check out for example PlotlyJS.jl , which offers offline plotly capability in Julia (i.e. not using the online plotly service).

 

On Thu, Apr 28, 2016 at 7:37 PM, David Anthoff <[hidden email]> wrote:

This is absolutely fantastic, what a hidden gem!

 

This might also be the best way to produce high quality graphs from julia at the moment, right?

 

I feel this whole approach should be made much more well known, I think many more people would be willing to use julia for their day-to-day work if they knew that they could easily use e.g. ggplot2 for plotting, and things like dplyr for data transformation etc.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Douglas Bates
Sent: Thursday, April 28, 2016 9:48 AM
To: julia-stats <
[hidden email]>
Subject: Re: [julia-stats] RCall example

 

On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:

Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

 

My recommendation would be to use the R"" string macro:

 

julia> R"library(ggplot2)";

 

julia> R"qplot(x, y, data = $df, colour = factor(tp))"

 

Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

 

R"""

  # write R code here

"""

 

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.

 

 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:

Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

 

I was able to make a plot with

 

julia> x = randn(100);

 

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

 

julia> @rput df;

 

julia> @rlibrary ggplot2

 

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))

RCall.RObject{RCall.VecSxp}

 

 

On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:

I've found that the tests are the best examples at the moment (this is often the case):

 

 

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
For more options, visit
https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

RE: RCall example

David Anthoff
In reply to this post by Michael Borregaard

I’m actually not that familiar with dplyr, so I can’t tell. But there are just a lot of people who have built up a lot of skill in using dplyr, and this makes it easy for them to continue to use those skills.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Michael Krabbe Borregaard
Sent: Thursday, April 28, 2016 10:54 AM
To: [hidden email]
Subject: Re: [julia-stats] RCall example

 

If I may ask, purely out of curiosity, which functionality from dplyr are you missing from DataFramesMeta?

 

On Thu, Apr 28, 2016 at 7:53 PM, Michael Krabbe Borregaard <[hidden email]> wrote:

There are many ways to produce high-quality graphs from Julia at the moment. Check out for example PlotlyJS.jl , which offers offline plotly capability in Julia (i.e. not using the online plotly service).

 

On Thu, Apr 28, 2016 at 7:37 PM, David Anthoff <[hidden email]> wrote:

This is absolutely fantastic, what a hidden gem!

 

This might also be the best way to produce high quality graphs from julia at the moment, right?

 

I feel this whole approach should be made much more well known, I think many more people would be willing to use julia for their day-to-day work if they knew that they could easily use e.g. ggplot2 for plotting, and things like dplyr for data transformation etc.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Douglas Bates
Sent: Thursday, April 28, 2016 9:48 AM
To: julia-stats <
[hidden email]>
Subject: Re: [julia-stats] RCall example

 

On Thursday, April 28, 2016 at 5:43:11 AM UTC-5, Simon Byrne wrote:

Sorry the documentation isn't great, part of the problem here is that we've been experimenting a lot with different approaches.

 

My recommendation would be to use the R"" string macro:

 

julia> R"library(ggplot2)";

 

julia> R"qplot(x, y, data = $df, colour = factor(tp))"

 

Exactly.  The simplest instructions for using RCall are to write R code in Julia but surround it with

 

R"""

  # write R code here

"""

 

As Simon shows, if you want to refer to a Julia object, well at least a Julia object that can be mapped to an R object, just use $<Julia object name>.  Simon did some wonderful work to ensure that the references to Julia objects are not confused with R's use of the $ symbol.

 

 

-simon

On Thursday, 28 April 2016 00:11:03 UTC+1, Andreas Noack wrote:

Also, take a look here http://juliastats.github.io/RCall.jl/latest/lib/public/#methods

 

I was able to make a plot with

 

julia> x = randn(100);

 

julia> df = DataFrame(x = x, y = [x[1:50]; 2x[51:100]] + 0.1randn(100), tp = [zeros(Int, 50); ones(Int, 50)]);

 

julia> @rput df;

 

julia> @rlibrary ggplot2

 

julia> reval(rparse("qplot(x, y, data = df, colour = factor(tp))"))

RCall.RObject{RCall.VecSxp}

 

 

On Wed, Apr 27, 2016 at 6:19 PM, Stefan Karpinski <[hidden email]> wrote:

I've found that the tests are the best examples at the moment (this is often the case):

 

 

On Wed, Apr 27, 2016 at 6:11 PM, David Anthoff <[hidden email]> wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
For more options, visit
https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

colintbowers
In reply to this post by David Anthoff
Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

<a href="http://www.david-anthoff.com" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.david-anthoff.com\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHPDijM7QgcCRbDWt_-VR5r_HnDGg&#39;;return true;">http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

David Anthoff

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Tom Breloff
Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

Best,
Tom

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

David Anthoff

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Tom Breloff
I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

ggplot(mydata100,
  aes(x = factor(""), fill = workshop) ) +
  geom_bar() +
  coord_polar(theta = "y") +
  scale_x_discrete("")

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

type PlotDescription
  args::Vector{Any}
  kw::KW
end

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

Best,
Tom


On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

David Anthoff

I very much doubt that you can create a proper grammar of graphics like API by just vcating args and kws like you describe. I once read (not carefully) the original book by Wilkinson, and properly implementing that seems like a major effort to me. This is *not* just a light API layer on top of some other API. I’m sure one could create such a gg API that then calls into Plots, but I think it would be a lot of work and would require an intimate familiarity with the whole gg philosophy to get the design right. Wickham’s writing on this would probably be also really helpful.

 

What I like about a gg API is pretty well described in either Wilkinson’s book, or for example Wickham’s ggplot2 book intro chapter.

 

I see the benefits one can get from Plots that you describe, but those are all things that I don’t need in my kind of work. Having a package that is super well documented, where there are a gazillion tutorials, examples etc. available and where I can be pretty sure that any type of graph that I might ever want to create can probably be done by far outweighs the downside of having to mix julia and R. My sense is that there are a lot of academic people out there that would be in a similar situation.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:06 PM
To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

 

ggplot(mydata100,

  aes(x = factor(""), fill = workshop) ) +

  geom_bar() +

  coord_polar(theta = "y") +

  scale_x_discrete("")

 

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

 

type PlotDescription

  args::Vector{Any}

  kw::KW

end

 

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

 

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

 

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

 

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

 

Best,

Tom

 

 

On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To:
[hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Tom Breloff
Ok if I get around to it maybe I'll throw together a proof of concept.  Generally I agree that this sort of thing would be a massive project, but the framework of Plots makes this a reasonably tractable problem to me.  I found this cheat sheet... is this a good aggregation of functionality that you find important, or is there more?

On Fri, Apr 29, 2016 at 3:40 PM, David Anthoff <[hidden email]> wrote:

I very much doubt that you can create a proper grammar of graphics like API by just vcating args and kws like you describe. I once read (not carefully) the original book by Wilkinson, and properly implementing that seems like a major effort to me. This is *not* just a light API layer on top of some other API. I’m sure one could create such a gg API that then calls into Plots, but I think it would be a lot of work and would require an intimate familiarity with the whole gg philosophy to get the design right. Wickham’s writing on this would probably be also really helpful.

 

What I like about a gg API is pretty well described in either Wilkinson’s book, or for example Wickham’s ggplot2 book intro chapter.

 

I see the benefits one can get from Plots that you describe, but those are all things that I don’t need in my kind of work. Having a package that is super well documented, where there are a gazillion tutorials, examples etc. available and where I can be pretty sure that any type of graph that I might ever want to create can probably be done by far outweighs the downside of having to mix julia and R. My sense is that there are a lot of academic people out there that would be in a similar situation.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:06 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

 

ggplot(mydata100,

  aes(x = factor(""), fill = workshop) ) +

  geom_bar() +

  coord_polar(theta = "y") +

  scale_x_discrete("")

 

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

 

type PlotDescription

  args::Vector{Any}

  kw::KW

end

 

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

 

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

 

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

 

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

 

Best,

Tom

 

 

On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To:
[hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

David Anthoff

Well, one of the nice things with ggplot2 is that even though I don’t use even a small fraction of it, I can be reasonably sure that anything I might want to use in the future is already there ;) So yes, that cheat sheet summarizes what I’ve been using. I would recommend to read the Wilkinson book before you start with this, the key point about a gg API is not a list like this cheat sheet, but rather the underlying consistent grammar, and I don’t think one can grasp that without reading the book…

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:59 PM
To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Ok if I get around to it maybe I'll throw together a proof of concept.  Generally I agree that this sort of thing would be a massive project, but the framework of Plots makes this a reasonably tractable problem to me.  I found this cheat sheet... is this a good aggregation of functionality that you find important, or is there more?

 

On Fri, Apr 29, 2016 at 3:40 PM, David Anthoff <[hidden email]> wrote:

I very much doubt that you can create a proper grammar of graphics like API by just vcating args and kws like you describe. I once read (not carefully) the original book by Wilkinson, and properly implementing that seems like a major effort to me. This is *not* just a light API layer on top of some other API. I’m sure one could create such a gg API that then calls into Plots, but I think it would be a lot of work and would require an intimate familiarity with the whole gg philosophy to get the design right. Wickham’s writing on this would probably be also really helpful.

 

What I like about a gg API is pretty well described in either Wilkinson’s book, or for example Wickham’s ggplot2 book intro chapter.

 

I see the benefits one can get from Plots that you describe, but those are all things that I don’t need in my kind of work. Having a package that is super well documented, where there are a gazillion tutorials, examples etc. available and where I can be pretty sure that any type of graph that I might ever want to create can probably be done by far outweighs the downside of having to mix julia and R. My sense is that there are a lot of academic people out there that would be in a similar situation.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:06 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

 

ggplot(mydata100,

  aes(x = factor(""), fill = workshop) ) +

  geom_bar() +

  coord_polar(theta = "y") +

  scale_x_discrete("")

 

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

 

type PlotDescription

  args::Vector{Any}

  kw::KW

end

 

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

 

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

 

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

 

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

 

Best,

Tom

 

 

On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To:
[hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

Tom Breloff
Ok you're probably referring to his 2005 book but I think this one is probably more relevant? http://byrneslab.net/classes/biol607/readings/wickham_layered-grammar.pdf

I've read it, and I also have extensive experience decomposing Gadfly.  Like I said, someday I'll try to throw together a proof of concept so you can see what I mean.  Actions speak louder than words, so... to be continued.

On Fri, Apr 29, 2016 at 4:04 PM, David Anthoff <[hidden email]> wrote:

Well, one of the nice things with ggplot2 is that even though I don’t use even a small fraction of it, I can be reasonably sure that anything I might want to use in the future is already there ;) So yes, that cheat sheet summarizes what I’ve been using. I would recommend to read the Wilkinson book before you start with this, the key point about a gg API is not a list like this cheat sheet, but rather the underlying consistent grammar, and I don’t think one can grasp that without reading the book…

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:59 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Ok if I get around to it maybe I'll throw together a proof of concept.  Generally I agree that this sort of thing would be a massive project, but the framework of Plots makes this a reasonably tractable problem to me.  I found this cheat sheet... is this a good aggregation of functionality that you find important, or is there more?

 

On Fri, Apr 29, 2016 at 3:40 PM, David Anthoff <[hidden email]> wrote:

I very much doubt that you can create a proper grammar of graphics like API by just vcating args and kws like you describe. I once read (not carefully) the original book by Wilkinson, and properly implementing that seems like a major effort to me. This is *not* just a light API layer on top of some other API. I’m sure one could create such a gg API that then calls into Plots, but I think it would be a lot of work and would require an intimate familiarity with the whole gg philosophy to get the design right. Wickham’s writing on this would probably be also really helpful.

 

What I like about a gg API is pretty well described in either Wilkinson’s book, or for example Wickham’s ggplot2 book intro chapter.

 

I see the benefits one can get from Plots that you describe, but those are all things that I don’t need in my kind of work. Having a package that is super well documented, where there are a gazillion tutorials, examples etc. available and where I can be pretty sure that any type of graph that I might ever want to create can probably be done by far outweighs the downside of having to mix julia and R. My sense is that there are a lot of academic people out there that would be in a similar situation.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:06 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

 

ggplot(mydata100,

  aes(x = factor(""), fill = workshop) ) +

  geom_bar() +

  coord_polar(theta = "y") +

  scale_x_discrete("")

 

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

 

type PlotDescription

  args::Vector{Any}

  kw::KW

end

 

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

 

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

 

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

 

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

 

Best,

Tom

 

 

On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To:
[hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: RCall example

David Anthoff

http://www.amazon.com/Grammar-Graphics-Statistics-Computing/dp/0387245448

 

and your link!

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 1:32 PM
To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Ok you're probably referring to his 2005 book but I think this one is probably more relevant? http://byrneslab.net/classes/biol607/readings/wickham_layered-grammar.pdf

 

I've read it, and I also have extensive experience decomposing Gadfly.  Like I said, someday I'll try to throw together a proof of concept so you can see what I mean.  Actions speak louder than words, so... to be continued.

 

On Fri, Apr 29, 2016 at 4:04 PM, David Anthoff <[hidden email]> wrote:

Well, one of the nice things with ggplot2 is that even though I don’t use even a small fraction of it, I can be reasonably sure that anything I might want to use in the future is already there ;) So yes, that cheat sheet summarizes what I’ve been using. I would recommend to read the Wilkinson book before you start with this, the key point about a gg API is not a list like this cheat sheet, but rather the underlying consistent grammar, and I don’t think one can grasp that without reading the book…

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:59 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Ok if I get around to it maybe I'll throw together a proof of concept.  Generally I agree that this sort of thing would be a massive project, but the framework of Plots makes this a reasonably tractable problem to me.  I found this cheat sheet... is this a good aggregation of functionality that you find important, or is there more?

 

On Fri, Apr 29, 2016 at 3:40 PM, David Anthoff <[hidden email]> wrote:

I very much doubt that you can create a proper grammar of graphics like API by just vcating args and kws like you describe. I once read (not carefully) the original book by Wilkinson, and properly implementing that seems like a major effort to me. This is *not* just a light API layer on top of some other API. I’m sure one could create such a gg API that then calls into Plots, but I think it would be a lot of work and would require an intimate familiarity with the whole gg philosophy to get the design right. Wickham’s writing on this would probably be also really helpful.

 

What I like about a gg API is pretty well described in either Wilkinson’s book, or for example Wickham’s ggplot2 book intro chapter.

 

I see the benefits one can get from Plots that you describe, but those are all things that I don’t need in my kind of work. Having a package that is super well documented, where there are a gazillion tutorials, examples etc. available and where I can be pretty sure that any type of graph that I might ever want to create can probably be done by far outweighs the downside of having to mix julia and R. My sense is that there are a lot of academic people out there that would be in a similar situation.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Friday, April 29, 2016 12:06 PM


To: [hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

I'm really curious... what is it about a "grammar of graphics API" that you really like?  I'm sure it would be feasible to layer a grammar on top of Plots calls (maybe it belongs in a separate package though?)  For an example (taken from http://r4stats.com/examples/graphics-ggplot2/):

 

ggplot(mydata100,

  aes(x = factor(""), fill = workshop) ) +

  geom_bar() +

  coord_polar(theta = "y") +

  scale_x_discrete("")

 

I could see implementing julia versions of ggplot, aes, geom_bar, etc all just populating a type like:

 

type PlotDescription

  args::Vector{Any}

  kw::KW

end

 

and then overloading Base.+ to vcat the args and merge the kw.  Then you could just splat the result into Plots when a display is requested, and you're done.

 

The benefit to doing something like this (rather than just going straight to ggplot2) is that you'd be able to use this "grammar" for many different scenarios... real-time updating using GR or GLVisualize, or server-side REPL plotting with UnicodePlots, etc.  (not to mention we could start weaning people away from R... it's one less reason to use it)

 

The obvious downside is that there might be things that are possible in ggplot2 but not in Plots.  If so, please open an issue!  :)

 

Let me know what you think about all this... I might be crazy but implementing this seems like it could be pretty straightforward if people really want it.

 

Best,

Tom

 

 

On Fri, Apr 29, 2016 at 2:30 PM, David Anthoff <[hidden email]> wrote:

This looks nice!

 

Having said that, I really like a grammar of graphics API, so having ggplot2 available now is just great (and as far as I know the only other grammar of graphic like package accessible from julia is Gadfly, right?)

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tom Breloff
Sent: Thursday, April 28, 2016 7:25 PM
To:
[hidden email]
Subject: Re: [julia-stats] Re: RCall example

 

Hi David.  I agree that there's a lot of development happening in the julia graphics world, but I would argue that it's pretty usable for day-to-day work.  A discussion about ggplot2 just happened in the Plots issues (https://github.com/tbreloff/Plots.jl/issues/201#issuecomment-214381703) that I think you might find interesting.  If you could post some visualization examples that you prefer in ggplot2 (with the input data), we might be able to show you an easier solution.

 

Best,

Tom

 

On Thu, Apr 28, 2016 at 7:45 PM, David Anthoff <[hidden email]> wrote:

Thanks, that is also helpful!

 

Simon actually wrote a really short Getting Started in the meantime, that essentially covers everything I had wanted to know:

 

http://juliastats.github.io/RCall.jl/latest/gettingstarted/

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email]
Sent: Thursday, April 28, 2016 4:40 PM
To: julia-stats <
[hidden email]>
Subject: [julia-stats] Re: RCall example

 

Not sure how much help it will be, but I wrote a Julia package that wraps the ARIMA functionality in R, and it uses RCall fairly heavily. I haven't added it to metadata, but it sounds like you only really want have a look at the source anyway to get some example code. The package source code is here:

https://github.com/colintbowers/RARIMA.jl/blob/master/src/RARIMA.jl

Cheers,

Colin

On Thursday, 28 April 2016 08:11:35 UTC+10, David Anthoff wrote:

Hi,

 

does someone have an example on how to use RCall.jl? I’d like to take a julia DataFrame, move that data into an R session and then call ggplot2 on it. But right now the package has no tutorial, or example or any hint for a beginner on how to use it :) Any example of how to use that package works would be appreciated.

 

Thanks,

David

 

--

David Anthoff

University of California, Berkeley

 

http://www.david-anthoff.com

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

 

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "julia-stats" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
12