我试图在闪亮的应用程序中绘制rChart并通过Rstudio服务器运行此程序。当我运行应用程序闪亮的页面给出错误:尝试应用非功能和RChart在新的浏览器窗口中打开。rChart在闪亮的应用程序中打开新窗口
如何使rChart出现在闪亮的应用程序中?
server.R
library(shiny)
require(rCharts)
names(iris) = gsub("\\.", "", names(iris))
shinyServer(function(input, output) {
output$myChart <- renderChart({
h1 <- hPlot(x = "Wr.Hnd", y = "NW.Hnd", data = MASS::survey,
type = c("line", "bubble", "scatter"), group = "Clap", size = "Age")
return(h1$show(cdn = TRUE))
})
})
ui.R
library(shiny)
require(rCharts)
shinyUI(pageWithSidebar(
headerPanel("rCharts and shiny"),
sidebarPanel(),
mainPanel(
showOutput("myChart")
)
))
我R对话信息
R version 3.0.2 (2013-09-25)
Platform: x86_64-pc-linux-gnu (64-bit)
other attached packages:
[1] shiny_0.7.0 plyr_1.8 rCharts_0.3.51 devtools_1.3 ggplot2_0.9.3.1 RMySQL_0.9-3 DBI_0.2-7