Skip to content

Commit 157afff

Browse files
committed
Make sure NULL defaults to "fixed"
1 parent 07c503c commit 157afff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

R/facet-grid-.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ facet_grid <- function(rows = NULL, cols = NULL, scales = "fixed",
123123
cols <- NULL
124124
}
125125

126-
scales <- arg_match0(scales, c("fixed", "free_x", "free_y", "free"))
126+
scales <- arg_match0(scales %||% "fixed", c("fixed", "free_x", "free_y", "free"))
127127
free <- list(
128128
x = any(scales %in% c("free_x", "free")),
129129
y = any(scales %in% c("free_y", "free"))
130130
)
131131

132-
space <- arg_match0(space, c("fixed", "free_x", "free_y", "free"))
132+
space <- arg_match0(space %||% "fixed", c("fixed", "free_x", "free_y", "free"))
133133
space_free <- list(
134134
x = any(space %in% c("free_x", "free")),
135135
y = any(space %in% c("free_y", "free"))

R/facet-wrap.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ facet_wrap <- function(facets, nrow = NULL, ncol = NULL, scales = "fixed",
8181
shrink = TRUE, labeller = "label_value", as.table = TRUE,
8282
switch = deprecated(), drop = TRUE, dir = "h",
8383
strip.position = 'top') {
84-
scales <- arg_match0(scales, c("fixed", "free_x", "free_y", "free"))
84+
scales <- arg_match0(scales %||% "fixed", c("fixed", "free_x", "free_y", "free"))
8585
dir <- arg_match0(dir, c("h", "v"))
8686
free <- list(
8787
x = any(scales %in% c("free_x", "free")),

0 commit comments

Comments
 (0)