class(x)

returns

[1] "plotly"     "htmlwidget"

where x is created using ggplotly.

So how about something like:

"plotly" %in% class(x)
[1] TRUE

You could make it into a function is.plotly:

is.plotly <- function(x) {
  "plotly" %in% class(x)
} 

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top