I accidentally ran this, and was rather confused for awhile until I realized I hadn't supplied an upper limit in xlim:
library(ggplot2)
df <- data.frame(
x = 1:5,
y = 2:6
)
ggplot(df, aes(x, y)) +
geom_line() +
coord_cartesian(xlim = 2)
#> Error in if (all(is.finite(continuous_range_coord)) && diff(continuous_range_coord) < : missing value where TRUE/FALSE needed
Could coord_cartesian(), or possibly something later on, throw an error if it doesn't get a length 2 xlim / ylim?
I accidentally ran this, and was rather confused for awhile until I realized I hadn't supplied an upper limit in
xlim:Could
coord_cartesian(), or possibly something later on, throw an error if it doesn't get a length 2xlim/ylim?