Error while deploying shiny app

425 views
Skip to first unread message

dhiraj deshmukh

unread,
Dec 29, 2017, 4:21:23 PM12/29/17
to shinyapps.io Users
Hello,

Can you please help me with the following?

my app.R file contains the following - 

library(shiny)
library(tm)
library(NLP)
library(stringr)
library(markdown)
library(dplyr) 
quadgram <- readRDS("./shiny/data/quadgram.rds")
trigram <- readRDS("./shiny/data/trigram.rds")
bigram <- readRDS("./shiny/data/bigram.rds") 
# a function code here 
# server.R code here 
# ui.R code here 
shinyApp(ui = ui, server = server)


In above code *.rds files generate through different .R file. What I need to do is use those files here in app.R and deploy the shiny app.

It keep saying "cannot open compressed file './shiny/data/quadgram.rds', probable reason 'No such file or directory'
Error in gzfile(file, "rb") : cannot open the connection"

Also I tried using setwd() command but then it says "Error in setwd(appDir) : cannot change working directory"

Can somebody please help me?

Thanks,
Dhiraj

dhiraj deshmukh

unread,
Dec 29, 2017, 4:40:23 PM12/29/17
to shinyapps.io Users
I just found that we should not provide the absolute path. But I have also tried using the relative path like copying all *.rds files into a directory and using the below command then -  

 quadgram <- readRDS("./shiny/data/quadgram.rds")

  But it says can not open compressed files, no such file or dir.


Thanks,
Dhiraj

dhiraj deshmukh

unread,
Dec 29, 2017, 7:05:19 PM12/29/17
to shinyapps.io Users
finally I got that all required files to deploy shiny app should be in project folder. 
It seems the app was deployed but giving an error that "An error has occurred. The application failed to start."
Reply all
Reply to author
Forward
0 new messages