Skip to content
Browse files

Use na.value in scale_continuous.

Fixes #522
  • Loading branch information...
1 parent 75e0b4a commit c718e2d23efd311f5509ee872d833c0125595139 @hadley committed
Showing with 4 additions and 1 deletion.
  1. +2 −0 NEWS
  2. +2 −1 R/scale-continuous.r
View
2 NEWS
@@ -27,6 +27,8 @@ DOCUMENTATION
BUG FIXES
+* `scale_x_continuous` now respects `na.value` (Fixes #522)
+
* `geom_map` now correctly uses set aesthetics (e.g. `colour = "green"`)
* Setting breaks outside the limits of the x or y axis no longer causes
View
3 R/scale-continuous.r
@@ -82,7 +82,8 @@ scale_y_continuous <- function(..., expand = waiver()) {
# can tell the difference between continuous and discrete data.
#' @S3method scale_map position_c
scale_map.position_c <- function(scale, x, limits = scale_limits(scale)) {
- as.numeric(scale$oob(x, limits))
+ scaled <- as.numeric(scale$oob(x, limits))
+ ifelse(!is.na(scaled), scaled, scale$na.value)
}
# Transformed scales ---------------------------------------------------------

0 comments on commit c718e2d

Please sign in to comment.
Something went wrong with that request. Please try again.