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
{{ message }}
Repository navigation
default xlim and ylim in qplot are not supportd when non missing #4027
See below. I think it's against the principles laid out in the tidyverse principle book, it can be fixed by using c(NA_real_, NA_real_) as a default.
The issue arose as I was writing a wrapper around qplot and it choked when passing the parameters xlim = xlim, ylim = ylim.
library(ggplot2)
# works
qplot(Sepal.Width, Sepal.Length, data=iris)
# doesn't work
qplot(Sepal.Width, Sepal.Length, data=iris, xlim= c(NA,NA))
#> Error in UseMethod("limits"): no applicable method for 'limits' applied to an object of class "logical"# works
qplot(Sepal.Width, Sepal.Length, data=iris, xlim= c(NA_real_,NA_real_))
Activity
clauswilke commentedon May 25, 2020
You are correct, though we tend to discourage use of
qplot()as much as possible. In any case, feel free to create a PR to fix this.