Closed
Description
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_))
Created on 2020-05-25 by the reprex package (v0.3.0)