Skip to content

Commit

Permalink
fix: if length 4.3.0 #520
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCoene committed May 4, 2023
1 parent be11ed0 commit 85324f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ globalVariables(c("x", "e", ".", "acc", "epoch", "loss", "size", "val_acc", "val
.assign_axis <- function(x, data) {
x$mapping$include_x <- FALSE
cl <- x$mapping$x_class
if (cl == "character" || cl == "factor") {
if (any(c("factor", "character") %in% cl)) {
labs <- unique(data[[x$mapping$x]])

if (length(labs) == 1) {
labs <- list(labs)
}

x$opts$xAxis <- list(list(data = labs, type = "category", boundaryGap = TRUE))
} else if (cl == "POSIXct" || cl == "POSIXlt" || cl == "Date") {
} else if (any(c("POSIXct", "POSIXlt", "Date") %in% cl)) {
labs <- unique(data[[x$mapping$x]])

if (length(labs) == 1) {
Expand Down

0 comments on commit 85324f3

Please sign in to comment.