Re: [R] gridExtra-arrangeGrob
I am not sure if something was wrong with my gridExtra installation or grid but after uninstall/re-install of the packages (and reboot) the code is working properly. Thank you all. On Monday, January 9, 2017 9:51 AM, David Winsemiuswrote: > On Jan 9, 2017, at 3:35 AM, John Kane via R-help wrote: > > I'm not sure what the problem is but, if nothing else, it looks like you need > to do > library(grid) > It may be that an early version of ggplot2 or gridExtra was automatically > loading grid and it no longer does. > > > > > On Monday, January 9, 2017 1:08 AM, Felipe Carrillo via R-help > wrote: > > > Hi;The code below used to work on my older version of gridExtra but doesn't >work with the new version. Could someonegive me a hint on how to translate >this code to the new version of gridExtra code? Thank you beforehand. > p1 <- ggplot(iris,aes(Sepal.Length, Petal.Length, colour=Species)) + > geom_point() + theme_bw() + theme(legend.position='top') > > grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .33,.33), ncol=1), >ncol=2) > #Create 2 columns with different width using the 'widths' argument in the >grid.arrange call > grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .40,.27), ncol=1), >ncol=2,widths=c(1.25,0.75)) > p <- rectGrob() > grid.arrange(p, arrangeGrob(p,p,p, heights=c(0.33, .33,.33), ncol=1), ncol=2) The lattice library attaches the grid functions via a namespace mechanism but it does not actually load the package. That meant that attempts to use grid functions from the console would fail. Perhaps this is also the practice of the ggplot2 authors? In any event, the grid.arrange and arrangeGrob functions are not from grid, but rather from gridExtra, which I am not seeing being loaded. -- David. > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] gridExtra-arrangeGrob
> On Jan 9, 2017, at 3:35 AM, John Kane via R-helpwrote: > > I'm not sure what the problem is but, if nothing else, it looks like you need > to do > library(grid) > It may be that an early version of ggplot2 or gridExtra was automatically > loading grid and it no longer does. > > > > >On Monday, January 9, 2017 1:08 AM, Felipe Carrillo via R-help > wrote: > > > Hi;The code below used to work on my older version of gridExtra but doesn't > work with the new version. Could someonegive me a hint on how to translate > this code to the new version of gridExtra code? Thank you beforehand. > p1 <- ggplot(iris,aes(Sepal.Length, Petal.Length, colour=Species)) + > geom_point() + theme_bw() + theme(legend.position='top') > > grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .33,.33), ncol=1), > ncol=2) > #Create 2 columns with different width using the 'widths' argument in the > grid.arrange call > grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .40,.27), ncol=1), > ncol=2,widths=c(1.25,0.75)) > p <- rectGrob() > grid.arrange(p, arrangeGrob(p,p,p, heights=c(0.33, .33,.33), ncol=1), ncol=2) The lattice library attaches the grid functions via a namespace mechanism but it does not actually load the package. That meant that attempts to use grid functions from the console would fail. Perhaps this is also the practice of the ggplot2 authors? In any event, the grid.arrange and arrangeGrob functions are not from grid, but rather from gridExtra, which I am not seeing being loaded. -- David. > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > > > [[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. David Winsemius Alameda, CA, USA __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
Re: [R] gridExtra-arrangeGrob
I'm not sure what the problem is but, if nothing else, it looks like you need to do library(grid) It may be that an early version of ggplot2 or gridExtra was automatically loading grid and it no longer does. On Monday, January 9, 2017 1:08 AM, Felipe Carrillo via R-helpwrote: Hi;The code below used to work on my older version of gridExtra but doesn't work with the new version. Could someonegive me a hint on how to translate this code to the new version of gridExtra code? Thank you beforehand. p1 <- ggplot(iris,aes(Sepal.Length, Petal.Length, colour=Species)) + geom_point() + theme_bw() + theme(legend.position='top') grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .33,.33), ncol=1), ncol=2) #Create 2 columns with different width using the 'widths' argument in the grid.arrange call grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .40,.27), ncol=1), ncol=2,widths=c(1.25,0.75)) p <- rectGrob() grid.arrange(p, arrangeGrob(p,p,p, heights=c(0.33, .33,.33), ncol=1), ncol=2) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] gridExtra-arrangeGrob
Hi;The code below used to work on my older version of gridExtra but doesn't work with the new version. Could someonegive me a hint on how to translate this code to the new version of gridExtra code? Thank you beforehand. p1 <- ggplot(iris,aes(Sepal.Length, Petal.Length, colour=Species)) + geom_point() + theme_bw() + theme(legend.position='top') grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .33,.33), ncol=1), ncol=2) #Create 2 columns with different width using the 'widths' argument in the grid.arrange call grid.arrange(p1, arrangeGrob(p1,p1,p1, heights=c(0.33, .40,.27), ncol=1), ncol=2,widths=c(1.25,0.75)) p <- rectGrob() grid.arrange(p, arrangeGrob(p,p,p, heights=c(0.33, .33,.33), ncol=1), ncol=2) [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.