Skip to content

Commit

Permalink
fallback for numeric expand
Browse files Browse the repository at this point in the history
  • Loading branch information
teunbrand committed Sep 11, 2024
1 parent d31c051 commit e2b64ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/coord-.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ render_axis <- function(panel_params, axis, scale, position, theme) {

# Elaborates an 'expand' argument for every side (top, right, bottom or left)
parse_coord_expand <- function(expand) {
if (is.numeric(expand) && all(expand %in% c(0, 1))) {
expand <- as.logical(expand)

Check warning on line 250 in R/coord-.R

View check run for this annotation

Codecov / codecov/patch

R/coord-.R#L250

Added line #L250 was not covered by tests
}
check_logical(expand)
if (anyNA(expand)) {
cli::cli_abort("{.arg expand} cannot contain missing values.")
Expand Down

0 comments on commit e2b64ce

Please sign in to comment.