Combine R shiny and googlevis motion chart

喜欢而已 提交于 2019-12-11 10:32:42

问题


I'd like to deploy a web site using R shiny with a googleVis motion chart, but when running the app, the motion chart showed up in another window in IE browser.

I'm wondering how the motion chart can show up together along with the R shiny. Thanks in advance.

server.R

  shinyServer(function(input, output) {

   project_sub<-subset(project_all, select=c("name", "generation",
                                      "man_cost", "quantity"))
   motionchart2<-gvisMotionChart(project_sub, "name", "year2") 

   output$view_gviz <- renderGvis
   ({
           plot(motionchart2)
   })
})

ui.R

  shinyUI(fluidPage(
     titlePanel("Analysis of Project NRE"),
     mainPanel(

        h1("Motion Chart"),
        h4("A Motion Chart is an alternative to providing a quick visual 
        overview ofprojects."),
        plotOutput("view_gviz")
      )
  ))

回答1:


I ran into this problem. Try this in your ui.R

# googleVis needs htmlOutput not usual PlotOutput
htmlOutput("view_gviz")


来源:https://stackoverflow.com/questions/32756687/combine-r-shiny-and-googlevis-motion-chart

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!