make_interactive: Make ggplot interactive using plotly

View source: R/make_interactive.R

make_interactiveR Documentation

Make ggplot interactive using plotly

Description

Convert a volcano or scatter plot to an interactive plotly object.

Usage

make_interactive(p, source = NULL, legend = T, sig_text = "")

Arguments

p

a ggplot (See details)

source

string. Used to connect plotly object other plotly objects.

legend

boolean. Show legend for significant interactors?

sig_text

what legend text should be added to a significant item?

Details

In order to make a plot interactive, they must be generated using plot_volcano_basic, plot_scatter_basic or/and plot_overlay.

See Also

Other interactivity: set_names_by_dataset(), tabulate_markers()

Examples

## Not run: 
df <- example_data %>%
  calc_mod_ttest() %>%
  id_significant_proteins()

# overlay simple a bait and make interactive
plt <- df %>% 
  plot_volcano_basic() %>%
  plot_overlay(as.bait('BCL2')) %>%
 volcano_theme() %>% 
  make_interactive()

plt

# save as html widget (requires htmlwidgets package)
htmlwidgets::saveWidget(as_widget(plt), "index.html")

## End(Not run)

lagelab/Genoppi documentation built on Oct. 13, 2022, 2:36 p.m.