You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was using ggplot2 from RProvider, but it stopped working from RProvider version 1.1.12. Ggplot normally composes plots by adding layers and the resulting plot needs to be evaluated as a whole. Currently, each layer is evaluated immediately which leads to no layers in plot errors.
Code to reproduce the error:
open RProvider
open RProvider.graphics
open RProvider.ggplot2
open RProvider.datasets
let (++) (plot1:RDotNet.SymbolicExpression) (plot2:RDotNet.SymbolicExpression) =
R.``+``(plot1, plot2)
fsi.AddPrinter(fun (synexpr:RDotNet.SymbolicExpression) ->
synexpr.Print())
let mtc = R.mtcars
R.assign("mtc", mtc)
R.eval(R.parse(text = "library(ggplot2)"))
// fails because the first call to ggplot is evaluated individually
R.eval(R.parse(text = "ggplot(mtc, aes(x=disp, y=drat))")) ++ R.geom__point()
The code worked in RProvider 1.1.8.
The text was updated successfully, but these errors were encountered:
I had a look at this and it seems to be caused by the fact that R.NET now automatically prints the results of expressions evaluated (this change sets AutoPrint to true). AFAIK this has no effect on R provider, because we are not capturing the automatic print output.
The reason why this breaks the above code is that R tries to show the incomplete chart created by the first part of the expression (before the ++). I think we can safely set AutoPrint = false in R provider because our F# Interactive load script prints things explicitly.
tpetricek
added a commit
to tpetricek/FSharp.RProvider
that referenced
this issue
Nov 14, 2015
I was using ggplot2 from RProvider, but it stopped working from RProvider version 1.1.12. Ggplot normally composes plots by adding layers and the resulting plot needs to be evaluated as a whole. Currently, each layer is evaluated immediately which leads to
no layers in plot
errors.Code to reproduce the error:
The code worked in RProvider 1.1.8.
The text was updated successfully, but these errors were encountered: