Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jan 21, 2025
1 parent b59607d commit f9acebf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions R/get_datagrid.R
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,14 @@ get_datagrid.comparisons <- get_datagrid.slopes
by_expression <- NULL
}
# If only two, it's probably the range
} else if (length(parts) == 2) {
by_expression <- paste0("seq(", parts[1], ", ", parts[2], ", length.out = length)")
# If more, it's probably the vector
} else if (length(parts) > 2L) {
parts <- as.numeric(parts)
by_expression <- paste0("c(", toString(parts), ")")
} else if (is.numeric(x)) {
if (length(parts) == 2) {
by_expression <- paste0("seq(", parts[1], ", ", parts[2], ", length.out = length)")
# If more, it's probably the vector
} else if (length(parts) > 2L) {
parts <- as.numeric(parts)
by_expression <- paste0("c(", toString(parts), ")")
}
} else {
by_expression <- NULL
}
Expand Down

0 comments on commit f9acebf

Please sign in to comment.