You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ggsave argument order is "counter intuitive" (when compared to other functions which write files, e.g., write_csv. By that I mean the plot and filename arguments).
It's clear to me that this is because ggsave was written long ago, without having %>% in mind, and perhaps putting filename first was equivalently reasonable.
I personally keep confusing the two.
I wonder if we can put some smart validation check in ggsave which if encounters a ggplot in the first argument and a string (i.e., path) in the second argument will figure out that arguments were specified in reversed order. Perhaps issue a warning but perform the export.
This will make it more compatible with other functions, and with the %>%, as well as backwards compatible.
The text was updated successfully, but these errors were encountered:
The ggsave argument order is "counter intuitive" (when compared to other functions which write files, e.g.,
write_csv
. By that I mean the plot and filename arguments).It's clear to me that this is because
ggsave
was written long ago, without having%>%
in mind, and perhaps putting filename first was equivalently reasonable.I personally keep confusing the two.
I wonder if we can put some smart validation check in
ggsave
which if encounters a ggplot in the first argument and a string (i.e., path) in the second argument will figure out that arguments were specified in reversed order. Perhaps issue a warning but perform the export.This will make it more compatible with other functions, and with the %>%, as well as backwards compatible.
The text was updated successfully, but these errors were encountered: