############### Library Declarations ###############
libraryRequireInstall("ggplot2");
libraryRequireInstall("plotly")
library("plotly")
library("ggplot2")
library("htmlwidgets")
####################################################
#g = plot_ly(mpg, x = mpg$cty, y = mpg$hwy, text = paste("Clarity: ", mpg$cyl),
#mode = "markers", color = mpg$cty, size = mpg$cty)
#library(plotly)
# Get Manufacturer
g <- mpg %>%
group_by(fl) %>%
summarise(count = n()) %>%
plot_ly(labels = ~fl, values = ~count) %>%
add_pie(hole = 0.6)
############# Create and save widget ###############
p = ggplotly(g);
internalSaveWidget(p, 'out.html');