Closed BrianLang closed 4 years ago
Somehow I'm still figuring out how to do all of this. Was there a way to do what you asked (merge to master, fix things, commit, and push) without opening a new pull request?
Yes, you can just keep pushing commits and github automatically sees them and updates the PR. No problem though, we can work with this one.
Sorry, one more issue. Can you try your plot reordering code for a case where num_plots
is less than rows * cols
? I think your matrix()
call will create a warning, and you should be able to fix this by padding 1:num_plots
with NA
s. Maybe this will work: c(1:num_plots, rep(NA, rows * cols - num_plots))
You were correct that having num_plots < cols * rows
produces warnings and issues, specifically that matrix recycles inputs. So I've added your suggestion of padding with c(1:num_plots, rep(NA, rows * cols - num_plots))
and it looks correct now.
It also is coincidental the case that the previous visual test gave a false "valid" for dropping the last NULL, so I've updated it to something that wouldn't pass given the previous implementation.
expect_doppelganger("colwise arranging", plot_grid(p1, NULL, p2, p3, NULL, byrow = FALSE) + theme_map() # add theme_map() for plot title )
Thanks!
Woooo! First merged pull request! Thanks for your help :-)
Thanks Claus and Brian for working on this request. I updated the cowplot package withinstall.package("cowplot")
. But the plot_grid() method doesn't seem to have the new 'byrow' parameter. I'd appreciate if you could tell me how to get the updated package.
You'll have to install the development version.
remotes::install_github("wilkelab/cowplot")
closes #161