Closed
Description
This bit me in a large,faceted plot where it wasn't entirely obvious what was going on:
d <- data.frame(x = 1:5, y = as.double(NA))
ggplot(data = d, aes(x, y)) + geom_point()
Error in seq.default(from = best$lmin, to = best$lmax, by = best$lstep) :
'from' must be of length 1
This is more like what caught me:
d <- expand.grid(x = 1:5, f = letters[1:5])
d$y <- rnorm(25)
is.na(d$y) <- d$f == 'a'
ggplot(data = d, aes(x, y)) + geom_point() + facet_wrap(~ f, scales = 'free_y')
Is it possible to catch this error?