我正在尝试在闪亮的应用程序中绘制rHighchart并通过Rstudio服务器运行它。当我运行应用程序时,闪亮页面会给出错误:'params'不是引用类“Chart”的有效字段或方法名称。该应用程序在Ubuntu 12.04中完美运行。但似乎无法在Windows 7中运行。我设法使用rCharts处理renderChart2,但我想知道是否有人有rHighchart的解决方案。
My session info in Windows:
R version 3.1.0 (2014-04-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rCharts_0.4.2 rHighcharts_1.0 devtools_1.5 RJSONIO_1.2-0.2 googleVis_0.5.2 shiny_0.9.1
My session info in Ubuntu:
R version 3.1.0 (2014-04-10)
Platform: x86_64-pc-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets
[6] methods base
other attached packages:
[1] rHighcharts_1.0 RJSONIO_1.2-0.2 googleVis_0.5.2
[4] rCharts_0.4.2 shiny_0.9.1
下面是应用程序的代码,唯一的区别是在Windows中我使用" Highcharts"在showOutput中调用Highcharts JS库。而不是highcharts":
**ui.R**
library("shiny")
require("rCharts")
mainPanel(
tabsetPanel(
tabPanel("Charts",
showOutput ("radar", "highcharts"),
),
**server. R**
library(rHighcharts)
output$bar<- renderChart({
a <- rHighcharts:::Chart$new()
a$title(text = paste0("Indicators by Country Year: ", input$year) )
a$subtitle(text = "Selected list of indicators")
a$xAxis(categories = rownames(passData()))
a$yAxis(title = list(text = "Indicator value"))
a$data(passData()[input$indicator],type = "column")
return(a)
})
感谢您的帮助!
涓