New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check.class argument to ggsave #970

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@baptiste
Contributor

baptiste commented Jun 2, 2014

optional by-pass of ggsave checks that an object of class ggplot is being recorded.
In addition, a grid.draw method is defined, rather than calling print()
directly, to allow other grobs such as modified gtables to be saved to a device with the same convenience.

check.class argument to ggsave
optional by-pass of ggsave checks that an object of class ggplot is being recorded. 
In addition, a grid.draw method is defined, rather than calling print()
directly, to allow other grobs such as modified gtables to be saved.
@hadley

This comment has been minimized.

Member

hadley commented Jun 11, 2015

Hmmm, I don't really like adding an additional argument. Any thoughts on alternative ways to check if it's saveable? Maybe we could have?

is_gridable <- function(x) UseMethod("is_gridable")
is_gridable.ggplot <- function(x) TRUE
is_gridable.grob <- function(x) TRUE
is_gridable.default <- function(x) FALSE

?

@hadley

This comment has been minimized.

Member

hadley commented Jun 18, 2015

Done in 7387d39

@hadley hadley closed this Jun 18, 2015

@baptiste

This comment has been minimized.

Contributor

baptiste commented Jun 19, 2015

Thanks! Any particular reason to have grid.draw.ggplot() calling print.ggplot(), and not the opposite?

@hadley

This comment has been minimized.

Member

hadley commented Jun 20, 2015

You're the one who wrote that ;) it probably should be the other way around but it required a bit too much thinking

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment