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

我与影子孤独终老i 提交于 2019-12-01 10:29:22

问题


I have a problem that seems to be quiet common but for which I haven't found a solution yet:

When trying to publish a webapp using rCharts Parcoords, I get this error: ERROR: path[1]="": No such file or directory

And the strange thing is that the app runs perfectly well on my laptop...

Below is a simple version/example of the code that I'm using. Please note that you need to have downloaded the parcoords library and put it into the file where you're working before you run the code. Its path is supposed to be: "libraries/widgets/parcoords"

Thank you in advance! :)

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
    }

  )

})

回答1:


I found the solution myself: showOutput needs the exact path to the parcoords-library, in my case: C:\Users\fklose\Desktop\Launching_Parcoords\libraries\widgets\parcoords.

So I changed the showOutput-line from

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

to

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

And the publishing worked :)



来源:https://stackoverflow.com/questions/36691327/error-path1-no-such-file-or-directory-when-publishing-parallel-coordina

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