tohtml: export as plotly html (only support ggplot2 object)

View source: R/tohtml.R

tohtmlR Documentation

export as plotly html (only support ggplot2 object)

Description

export as plotly html (only support ggplot2 object)

Usage

tohtml(figure, filename = "temp.html", save = TRUE)

Arguments

figure

output figure function, set NULL output the current figure

filename

output format (could be ingored)

save

save figure or not (default: TRUE)

Author(s)

Kai Guo

Examples

if(interactive()){
require(ggplot2)
p <- ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) + geom_point()
tohtml(p,filename = file.path(tempdir(), "mtcars.html"))
## or use ggplot directly
ggplot(mtcars, aes(mpg, disp, color = factor(cyl))) +
geom_point()
tohtml(save = FALSE)
}

eoffice documentation built on Oct. 5, 2022, 9:05 a.m.