Search code examples
rshinyrcharts

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


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
    }

  )

})

Solution

  • 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 :)