{"action":"created","issue":{"url":"https://api.github.com/repos/baptiste/gridextra/issues/6","labels_url":"https://api.github.com/repos/baptiste/gridextra/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/baptiste/gridextra/issues/6/comments","events_url":"https://api.github.com/repos/baptiste/gridextra/issues/6/events","html_url":"https://github.com/baptiste/gridextra/issues/6","id":94275494,"number":6,"title":"marrangeGrob may fail in RStudio","user":{"login":"fabian-s","id":998541,"avatar_url":"https://avatars.githubusercontent.com/u/998541?v=3","gravatar_id":"","url":"https://api.github.com/users/fabian-s","html_url":"https://github.com/fabian-s","followers_url":"https://api.github.com/users/fabian-s/followers","following_url":"https://api.github.com/users/fabian-s/following{/other_user}","gists_url":"https://api.github.com/users/fabian-s/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-s/subscriptions","organizations_url":"https://api.github.com/users/fabian-s/orgs","repos_url":"https://api.github.com/users/fabian-s/repos","events_url":"https://api.github.com/users/fabian-s/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-s/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-10T10:21:11Z","updated_at":"2015-07-10T11:39:07Z","closed_at":null,"body":"Calling `marrangeGrob` in RStudio always yields:\r\n``` \r\nWarning message:\r\nIn (function ()  : Only one RStudio graphics device is permitted\r\n```\r\nand does not have the desired result if multiple pages are necessary  -- pages simply get rendered on top of each other, so only the last one is fully visible.\r\n\r\nIn my code for the update of package `spikeSlabGAM` for `gridExtra 2.0`, I have \"solved\" this by doing:\r\n\r\n```r\r\n# function definition contains argument interactive.dev = c(\"x11\", \"quartz\", \"windows\")\r\n# plotList: list of ggplots to render\r\n# nrow, ncol as in marrangeGrob\r\n\r\ninteractive.dev <- match.arg(interactive.dev)\r\nrstudio <- options()$device == \"RStudioGD\"\r\n\r\nif(dev.interactive()){\r\n  rstudio <- options()$device == \"RStudioGD\"\r\n  if(rstudio & nrow*ncol < length(plotList)) {\r\n    message(\"Temporarily setting <options(device='\",interactive.dev,\"')> to open multiple graphics displays since dispatch on multiple graphic devices is not supported in RStudio.\")\r\n    options(device=interactive.dev)\r\n    on.exit(options(device=\"RStudioGD\"))\r\n  }\r\n}\r\n```\r\nMaybe something like this could be useful inside the package itself as well. Of course the active device still remains the one opened last by `marrangeGrob` despite the `on.exit`-code and subsequent figures are rendered there and not in the RStudio graphics window, but: that's life... :hankey: "},"comment":{"url":"https://api.github.com/repos/baptiste/gridextra/issues/comments/120392156","html_url":"https://github.com/baptiste/gridextra/issues/6#issuecomment-120392156","issue_url":"https://api.github.com/repos/baptiste/gridextra/issues/6","id":120392156,"user":{"login":"fabian-s","id":998541,"avatar_url":"https://avatars.githubusercontent.com/u/998541?v=3","gravatar_id":"","url":"https://api.github.com/users/fabian-s","html_url":"https://github.com/fabian-s","followers_url":"https://api.github.com/users/fabian-s/followers","following_url":"https://api.github.com/users/fabian-s/following{/other_user}","gists_url":"https://api.github.com/users/fabian-s/gists{/gist_id}","starred_url":"https://api.github.com/users/fabian-s/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabian-s/subscriptions","organizations_url":"https://api.github.com/users/fabian-s/orgs","repos_url":"https://api.github.com/users/fabian-s/repos","events_url":"https://api.github.com/users/fabian-s/events{/privacy}","received_events_url":"https://api.github.com/users/fabian-s/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T11:39:07Z","updated_at":"2015-07-10T11:39:07Z","body":"alright, makes sense. thanks for the prompt reply."}}