"ERROR: path[1]="": No such file or directory" when publishing Parallel Coordinates Chart with Shiny

"ERROR: path[1]="": No such file or directory" when publishing Parallel Coordinates Chart with Shiny

我有一个似乎很常见但我还没有找到解决方案的问题:

尝试使用 rCharts Parcoords 发布 webapp 时,出现此错误: 错误:路径[1]="":没有这样的文件或目录

奇怪的是,该应用 运行 在我的笔记本电脑上运行得非常好...

下面是我正在使用的代码的简单 version/example。 请注意,在 运行 代码之前,您需要下载 parcoords 库并将其放入您正在工作的文件中。它的路径应该是:"libraries/widgets/parcoords"

提前致谢! :)

ui.R:

library(shiny)
library(shinydashboard)
library(rCharts)

sidebar <- dashboardSidebar(
width = 250,
sidebarMenu(id = "menu1"
              ,menuItem("Parallel Coordinates Chart", tabName = "parcoords", icon = icon("line-chart"))
  )

)


body <- dashboardBody(

tabItems(

       tabItem(tabName = "parcoords",
            fluidRow(
              column(10, offset = 1,
                     tabBox(width = 13.5,height=8,
                            id ="colors", 
                            tabPanel("Multicolor",showOutput("chart1", "parcoords")) )
            )
           )
    )
  )
)

shinyUI(dashboardPage(
  dashboardHeader( title = "Parallel Coordinates Chart"
                  ,titleWidth = 450),
  sidebar,
  body
))

server.R:

library(shiny)
library(shinydashboard)
library(rCharts)


shinyServer(function(input, output) {

dat <- Theoph

output$chart1 <- renderChart2({


      p1 <- rCharts$new()
      p1$setLib("libraries/widgets/parcoords")

      p1$set(padding = list(top = 50, bottom = 50,
                            left = 50, right = 50),
             width = 1200, height = 600)


      p1$set(
        data = toJSONArray(dat, json = F),
        range = unique(dat$Subject),
        colorby = 'Subject',
        colors = c('red', 'green', 'yellow','blue','black', 'pink', 'brown', 'orange', 'grey', 'maroon', 'plum')) 
      p1
    }

  )

})

我自己找到了解决方案: showOutput 需要 parcoords 库的确切路径,在我的例子中:C:\Users\fklose\Desktop\Launching_Parcoords\libraries\widgets\parcoords.

所以我将 showOutput-line 从

tabPanel("Multicolor",showOutput("chart1", "parcoords"))

tabPanel("Multicolor",showOutput("chart1", "libraries/widgets/parcoords"))

并且发布成功:)