Convert expressions in ggplot object labels to strings, to enable them to be plotted with ggplotly.

rmExpr(p = ggplot2::last_plot())

Arguments

p

ggplot2 object

Value

`ggplot2` object

Author

Vilmantas Gegzna

Examples


# \donttest{
if (FALSE) {
data(flu, package = "hyperSpec")

qplotspc(flu)
ggplotly()

rmExpr()
ggplotly()

#--------------------------------
p1 <- qplot_sp(Loadings2)
p1$labels

p2 <- rmExpr(p1)
p2$labels

ggplotly(p1)
ggplotly(p2)

#----------------------------------
qplotspc(aggregate(chondro, chondro$clusters, mean_pm_sd),
mapping = aes(x = .wavelength,
              y = spc,
              colour = clusters)) +
    facet_grid(clusters ~ .) + ggtitle("Spectra of Chondrocytes")

 rmExpr()
 ggplotly()

}# }