Please note that this feature is experimental and not all aspects of ggplot2 are supported by plotly!
To learn more about plotly you visit this page.
This command is only required for the first use.
install.packages("plotly")
Start by loading the plotly and xpose packages.
library(plotly) library(xpose)
Then generate any plot in xpose and store it in an object.
gof_plot <- dv_vs_ipred(xpdb_ex_pk, type = 'pl', aes(point_color = SEX, line_color = SEX)) + labs(color = 'Sex', title = 'DV vs IPRED')
The ggplot2 object is now automatically converted to a plotly graph. The scales can now be changed interactively, groups can be hidden by clicking on the legend
plotly::ggplotly(gof_plot)
xpdb_ex_pk %>% eta_distrib(title = 'Eta distribution') %>% plotly::ggplotly()
xpdb_ex_pk %>% vpc_data() %>% vpc(title = 'Visual predictive checks', type = 'alpr') %>% plotly::ggplotly()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.