【发布时间】:2015-05-19 20:34:13
【问题描述】:
使用现有问题的答案作为可重现代码here的基础
我收到以下错误,但不确定为什么它不起作用...在将 hPlot 类型图表呈现为闪亮时,这似乎是一个普遍问题,因为我不断收到相同的错误
Listening on http://127.0.0.1:7537
Error in normalizePath(directoryPath, mustWork = TRUE) :
path[1]="": No such file or directory
Error in normalizePath(directoryPath, mustWork = TRUE) :
path[1]="": No such file or directory
> traceback()
21: normalizePath(directoryPath, mustWork = TRUE)
20: addResourcePath(LIB$name, LIB$url)
19: singleton(addResourcePath(LIB$name, LIB$url))
18: withCallingHandlers(expr, message = function(c) invokeRestart("muffleMessage"))
17: suppressMessages(singleton(addResourcePath(LIB$name, LIB$url)))
16: showOutput("myChart", "Highcharts")
15: tag("div", list(...))
14: tags$div(...)
13: div(class = paste0("col-sm-", width), ...)
12: mainPanel(showOutput("myChart", "Highcharts"))
11: tag("div", list(...))
10: tags$div(...)
9: div(class = "row", sidebarPanel, mainPanel)
8: tag("div", list(...))
7: tags$div(...)
6: div(class = "container-fluid", div(class = "row", headerPanel),
div(class = "row", sidebarPanel, mainPanel))
5: tagList(if (!is.null(title)) tags$head(tags$title(title)), if (!is.null(theme)) {
tags$head(tags$link(rel = "stylesheet", type = "text/css",
href = theme))
}, list(...))
4: attachDependencies(tagList(if (!is.null(title)) tags$head(tags$title(title)),
if (!is.null(theme)) {
tags$head(tags$link(rel = "stylesheet", type = "text/css",
href = theme))
}, list(...)), importBootstrap())
3: bootstrapPage(div(class = "container-fluid", div(class = "row",
headerPanel), div(class = "row", sidebarPanel, mainPanel)))
2: pageWithSidebar(headerPanel("rCharts: Highcharts"), sidebarPanel(selectInput(inputId = "x",
label = "Choose X", choices = c("SepalLength", "SepalWidth",
"PetalLength", "PetalWidth"), selected = "SepalLength")),
mainPanel(showOutput("myChart", "Highcharts")))
1: runApp(list(ui = pageWithSidebar(headerPanel("rCharts: Highcharts"),
sidebarPanel(selectInput(inputId = "x", label = "Choose X",
choices = c("SepalLength", "SepalWidth", "PetalLength",
"PetalWidth"), selected = "SepalLength")), mainPanel(showOutput("myChart",
"Highcharts"))), server = function(input, output) {
output$myChart <- renderChart2({
h1 <- Highcharts$new()
h1$chart(type = "spline")
h1$series(data = c(1, 3, 2, 4, 5), dashStyle = "longdash")
h1$series(data = c(NA, 4, 1, 3, 4), dashStyle = "shortdot")
h1$legend(symbolWidth = 80)
return(h1)
})
}))
下面是我在 rCharts 中升级后的 sessionInfo...导致相同的错误...还请注意,在 RStudio 的查看器中查看时,突出显示图表在本地工作,但在使用 showOutput 函数时不闪亮
> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: powerpc64le-unknown-linux-gnu (64-bit)
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_GB.UTF-8 LC_COLLATE=en_GB.UTF-8
[5] LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] shiny_0.11.1 rCharts_0.4.5
loaded via a namespace (and not attached):
[1] codetools_0.2-8 digest_0.6.8 grid_3.1.1 htmltools_0.2.6
[5] httpuv_1.3.2 lattice_0.20-29 mime_0.3 nabor_0.4.4
[9] plyr_1.8.1 R6_2.0.1 Rcpp_0.11.5 RJSONIO_1.3-0
[13] tools_3.1.1 whisker_0.3-2 xtable_1.7-4 yaml_2.1.13
【问题讨论】:
-
试试
output$myChart <- renderChart({ h1 <- Highcharts$new() h1$set(dom = "myChart") }) -
还需要安装开发版的 rcharts install_github('rCharts', 'ramnathv',ref='dev')
-
删除并重新安装 rshiny 和 rcharts(您可能还需要重新安装其他依赖项)
标签: r highcharts shiny rcharts