library(shiny)
library(ggplot2)
library(plotly)
ui <- fluidPage(
plotlyOutput("plot")
)
server <- function(input, output) {
output$plot <- renderPlotly({
pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
geom_bar(width = 1)
pie + coord_polar(theta = "y")
ggplotly()
})
}
shinyApp(ui, server)
--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/68e34477-4851-4885-984e-d07dc9dec1b3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
geom_bar(width = 1)
pie + coord_polar(theta = "y")
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/6c2ec39b-c4cc-47ee-a94b-63572f73100c%40googlegroups.com.
rm(list = ls())
library(shiny)
library(ggplot2)
library(plotly)
ui <- fluidPage(
plotlyOutput("plot")
)
server <- function(input, output) {
data=data.frame(group=c("A ","B ","C ","D ") , value=c(33,62,56,67) )
output$plot <- renderPlotly({
pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
geom_bar(width = 1)
pie <- pie + coord_polar(theta = "y")
ggplotly(pie)
})
}
shinyApp(ui, server)
To view this discussion on the web visit https://groups.google.com/d/msgid/shiny-discuss/4ecb67dc-43f6-4fc5-89bb-d990097f0950%40googlegroups.com.
pie <- ggplot(mtcars, aes(x = factor(1), fill = factor(cyl))) +
geom_bar(width = 1)
pie <- pie + coord_polar(theta = "y")
ggplotly(pie)