Skip to content

Commit d6c36ce

Browse files
jrwishartchschan
authored andcommitted
DS-4923 Only check QTable class (#21)
1 parent 86ff33f commit d6c36ce

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

R/plotly.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ plot_ly <- function(data = data.frame(), ..., type = NULL, name,
142142
}
143143

144144
if (is.data.frame(data) && nrow(data) > 0L) {
145-
qtables <- vapply(data, inherits, logical(1L), c("qTable", "QTable"))
145+
qtables <- vapply(data, inherits, logical(1L), "QTable")
146146
if (any(qtables))
147147
data[qtables] <- lapply(data[qtables], as.vector)
148148
}

tests/testthat/test-plotly.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,7 @@ test_that("Check QTables dont cause errors", {
364364
x2 = array(runif(n), dim = n),
365365
y = factor(letters[1:10])
366366
)
367-
class(s[[1]]) <- "QTable"
368-
class(s[[2]]) <- "qTable"
367+
class(s[[1]]) <- class(s[[2]]) <- "QTable"
369368
expect_error(p <- plot_ly(s) |>
370369
add_segments(x = ~x, xend = ~x2, y = ~y, yend = ~y, showlegend = FALSE) |>
371370
add_markers(x = ~x, xend = ~y, y = ~y, name = "foo", color = I("orange"), showlegend = FALSE) |>

0 commit comments

Comments
 (0)