Warning

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.

Install plotly

This command is only required for the first use.

Load packages

Start by loading the plotly and xpose packages.

library(plotly)
library(xpose)

Generate a plot with xpose

Then generate any plot in xpose and store it in an object.

## Using data from $prob no.1
## Filtering data by EVID == 0

Convert the plot from ggplot2 to plotly

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

Other examples

A distribution

xpdb_ex_pk %>% 
  eta_distrib(title = 'Eta distribution') %>% 
  plotly::ggplotly()

VPC

xpdb_ex_pk %>% 
  vpc_data() %>% 
  vpc(title = 'Visual predictive checks', type = 'alpr') %>% 
  plotly::ggplotly()