Skip to content

Commit f35ea8a

Browse files
committed
Fix documentation for ylim
The range of mtcars wt data is from 1.513 to 5.424, so the previous example was causing an error because there were no points to obtain a range from.
1 parent d9f468c commit f35ea8a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

R/limits.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
#' ylim(15, 20)
2525
#' ylim(c(10, 20))
2626
#' ylim("a", "b", "c")
27-
#' qplot(mpg, wt, data=mtcars) + ylim(15, 20)
27+
#' qplot(mpg, wt, data=mtcars) + ylim(0, 4)
2828
#' # with automatic upper limit
29-
#' qplot(mpg, wt, data=mtcars) + ylim(15, NA)
29+
#' qplot(mpg, wt, data=mtcars) + ylim(0, NA)
3030
xlim <- function(...) {
3131
limits(c(...), "x")
3232
}

man/xylim.Rd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ qplot(mpg, wt, data=mtcars) + xlim(NA, 20)
3131
ylim(15, 20)
3232
ylim(c(10, 20))
3333
ylim("a", "b", "c")
34-
qplot(mpg, wt, data=mtcars) + ylim(15, 20)
34+
qplot(mpg, wt, data=mtcars) + ylim(0, 4)
3535
# with automatic upper limit
36-
qplot(mpg, wt, data=mtcars) + ylim(15, NA)
36+
qplot(mpg, wt, data=mtcars) + ylim(0, NA)
3737
}
3838
\seealso{
3939
For changing x or y axis limits \strong{without} dropping data

0 commit comments

Comments
 (0)