50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

eoffice (version 0.2.2)

tohtml: 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

Kai Guo

Examples

Run this code
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)
}

Run the code above in your browser using DataLab