diff --git a/R/plotly.R b/R/plotly.R index c0599ed874..d67b000722 100644 --- a/R/plotly.R +++ b/R/plotly.R @@ -140,7 +140,12 @@ plot_ly <- function(data = data.frame(), ..., type = NULL, name, if (!is.data.frame(data) && !crosstalk::is.SharedData(data)) { stop("First argument, `data`, must be a data frame or shared data.", call. = FALSE) } - + if (is.data.frame(data) && nrow(data) > 0L) { + qtables <- vapply(data, inherits, logical(1L), c("qTable", "QTable")) + if (any(qtables)) + data[qtables] <- lapply(data[qtables], unclass) + } + # "native" plotly arguments attrs <- list(...)