My Shiny app will run locally, but when I try to deploy to shinyapps.io it will not. I temporarily fixed the problem by removing the 'dot' in the path to the .csv
file:
data <- read.csv("/Users/JMJC/Desktop/bbteams-shiny/bbteams.csv")
But when it deployed to shinyapps.io I received a different error, ERROR: cannot open the connection.
shinyapps::deployApp('/Users/JMJC/Desktop/bbteams-shiny')
I placed my data set in the same directory as server.r and ui.r. And I made sure to setwd()
to the same directory.
I'm out of ideas. If I don't remove the dot it will not deploy, but if I do remove the dot it cannot make the connection. If I force it to deploy, it still will not make the connection.
As @DieterMenne already stated in the answer section: Simple solution:
read.csv("bbteams.csv")
Useful link for this and other issues:
https://support.rstudio.com/hc/en-us/articles/229848967-Why-does-my-app-work-locally-but-not-on-shinyapps-io-
Make sure the path you give for the data file and the path for you R files is the same. So you do not need to mention the whole path, in your case
data <- read.csv("/Users/JMJC/Desktop/bbteams-shiny/bbteams.csv")
instead just use
read.csv("bbteams.csv")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With