Closed jkylearmstrong closed 3 months ago
This is a duplicate of #202. That issue also contains a suggested alternative implementation by Teun van den Brand that I think is the right way forward. If you want to prepare a PR based on that you're welcome to do so.
@clauswilke my apologies, I should have checked to see if someone else had already commented on the error.
From the discussion, it seems like the fix in https://github.com/wilkelab/cowplot/issues/202 allows the user to pass along the expected location which is also reasonable.
It still might be worthwhile to consider filtering out the zeroGrubs from get_plot_component
when the user only expects one return, at least then the return object will always contain a non-zero grub if the expected behavior is to return a zeroGrub if all are zero, then you could modify my proposed solution https://github.com/wilkelab/cowplot/pull/206 to account for that.
Either way, thank you for this package, it's handy, just trying to see if I could help contribute and make it better! :)
That's fine, you're welcome to merge your ideas and Teun's ideas in your PR. I haven't thought about this function much recently but I agree it should be fixed.