I went through all of the steps found here, and even got the following message without error:
Application successfully deployed to https://user-name.shinyapps.io/projectFolder/
However, I get the ERROR: cannot open the connection
message when trying to run the program. Here are the contents of the folder (projectFolder
) to which I directed R Studio:
ui.R # contains only ui code
server.R # contains only server code
script.R # my full script, which contains global, ui, and server code
gomap.js # used for mapping app
styles.css # used for Shiny App
data.csv # my global data to be hosted on shinyapps.io
Here's a sample of the different scripts:
ui.R
ui <- shinyUI(navbarPage("Tab title", id="nav",
tabPanel("Interactive map",
div(class="outer",
tags$head(
includeCSS("/Users/user/Documents/R/projects/styles.css"),
includeScript("/Users/user/Documents/R/projects/gomap.js")
),
#### more UI code ####
))
))
Might the issue be because of the filepaths above? Do I need to setwd
at the top of both the ui.R
and server.R
files? Or is it because within script.R
you can find the full code for ui.R
and server.R
(perhaps this is redundant and I need to create a global.R
file with just the data loading and manipulation?
The overarching question is, how do you break up your files to load onto shinyapps.io?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…