Skip to content

Commit

Permalink
Make sure NULL defaults to "fixed"
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Oct 7, 2022
1 parent 07c503c commit 157afff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/facet-grid-.r
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ facet_grid <- function(rows = NULL, cols = NULL, scales = "fixed",
cols <- NULL
}

scales <- arg_match0(scales, c("fixed", "free_x", "free_y", "free"))
scales <- arg_match0(scales %||% "fixed", c("fixed", "free_x", "free_y", "free"))
free <- list(
x = any(scales %in% c("free_x", "free")),
y = any(scales %in% c("free_y", "free"))
)

space <- arg_match0(space, c("fixed", "free_x", "free_y", "free"))
space <- arg_match0(space %||% "fixed", c("fixed", "free_x", "free_y", "free"))
space_free <- list(
x = any(space %in% c("free_x", "free")),
y = any(space %in% c("free_y", "free"))
Expand Down
2 changes: 1 addition & 1 deletion R/facet-wrap.r
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ facet_wrap <- function(facets, nrow = NULL, ncol = NULL, scales = "fixed",
shrink = TRUE, labeller = "label_value", as.table = TRUE,
switch = deprecated(), drop = TRUE, dir = "h",
strip.position = 'top') {
scales <- arg_match0(scales, c("fixed", "free_x", "free_y", "free"))
scales <- arg_match0(scales %||% "fixed", c("fixed", "free_x", "free_y", "free"))
dir <- arg_match0(dir, c("h", "v"))
free <- list(
x = any(scales %in% c("free_x", "free")),
Expand Down

0 comments on commit 157afff

Please sign in to comment.