2

I'd like to get a plot generated by ggplot2 in Mathematica but using the getRPlot function doesn't seem to work:

REvaluate["library(ggplot2)"];
Show[#, ImageSize -> Medium, PlotRange -> All] & getRPlot[
  RFunction["function(){
   qplot(Sepal.Length, Petal.Length, data = iris, color = Species)
   }"]]

I get the following error message:

Import::general: "Document only has 0 page(s)"

Any alternatives?

Ruben Garcia
  • 637
  • 3
  • 9
  • 1
    Something goes wrong in the R code and the PDF doesn't quite export right. I can't open it with Preview.app either. I guess that makes this an R question, not a Mathematica one ... You'll get a faster answer if you extract the plot exporting code from getRPlot and ask on StackOverflow about what goes wrong during exporting. I don't know enough R to help. – Szabolcs Feb 16 '16 at 19:29
  • Give this a try: https://github.com/ayule89/ggplot – sra Feb 15 '21 at 20:39

0 Answers0