diff --git a/R/plotly.R b/R/plotly.R index 776d037963..1e47c67821 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -142,7 +142,7 @@ plot_ly <- function(data = data.frame(), ..., type = NULL, name, } if (is.data.frame(data) && nrow(data) > 0L) { - qtables <- vapply(data, inherits, logical(1L), c("qTable", "QTable")) + qtables <- vapply(data, inherits, logical(1L), "QTable") if (any(qtables)) data[qtables] <- lapply(data[qtables], as.vector) } diff --git a/tests/testthat/test-plotly.R b/tests/testthat/test-plotly.R index 979a9a8296..f3c437694d 100644 --- a/tests/testthat/test-plotly.R +++ b/tests/testthat/test-plotly.R @@ -365,8 +365,7 @@ test_that("Check QTables dont cause errors", { x2 = array(runif(n), dim = n), y = factor(letters[1:10]) ) - class(s[[1]]) <- "QTable" - class(s[[2]]) <- "qTable" + class(s[[1]]) <- class(s[[2]]) <- "QTable" expect_error(p <- plot_ly(s) |> add_segments(x = ~x, xend = ~x2, y = ~y, yend = ~y, showlegend = FALSE) |> add_markers(x = ~x, xend = ~y, y = ~y, name = "foo", color = I("orange"), showlegend = FALSE) |>