ggplt: Simplify plotly ggplot conversion so that there are no...

View source: R/plot_shared.R

ggpltR Documentation

Simplify plotly ggplot conversion so that there are no shenanigans.

Description

I am a fan of ggplotly, but its conversion to an html file is not perfect. This hopefully will get around the most likely/worst problems.

Usage

ggplt(
  gg,
  filename = "ggplot.html",
  selfcontained = TRUE,
  libdir = NULL,
  background = "white",
  plot_title = class(gg)[[1]],
  knitrOptions = list(),
  ...
)

Arguments

gg

Plot from ggplot2.

filename

Output filename.

selfcontained

htmlwidgets: Return the plot as a self-contained file with images re-encoded base64.

libdir

htmlwidgets: Directory into which to put dependencies.

background

htmlwidgets: String for the background of the image.

plot_title

htmlwidgets: Title of the page!

knitrOptions

htmlwidgets: I am not a fan of camelCase, but nonetheless, options from knitr for htmlwidgets.

...

Any remaining elipsis options are passed to ggplotly.

Value

The final output filename

See Also

[htmlwidgets] [plotly] [ggplot2]


elsayed-lab/hpgltools documentation built on May 9, 2024, 5:02 a.m.