shiny app works locally, but not on shinyapps.io
By : Dom
Date : March 29 2020, 07:55 AM
Hope that helps I solved this problem by using dbConnect & DBI libraries instead of RODBC and using RSQLServer::SQLServer() to open the connection on the sql server. and i thanks @PorkChop for give me a help in that.
|
R Shiny - uploading multiple csv works locally but not on shinyapps.io
By : Arun Popli
Date : March 29 2020, 07:55 AM
Any of those help You should not use csv_names <- input$file1[['name']] in your server, this only return the file name, not file path, so when you use read.csv to read the csv file, the error occured. The following should work fine. code :
library(shiny)
library(shinydashboard)
dashboardPage( skin = "black",
dashboardHeader(title = "myApp"),
dashboardSidebar(collapsed = TRUE,
sidebarMenu(
menuItem("Home", tabName = "dashboard1", icon = icon("home", lib =
"glyphicon"))
)
),
dashboardBody(
tags$head(tags$style(HTML('
.main-header .logo {
font-family: "Times New Roman", serif;
font-weight: bold;
font-size: 24px;
}
'))),
tabItems(
tabItem(tabName = "dashboard1",
fileInput("file1",
label="Input files:",
multiple = TRUE),
downloadButton('plot.pdf', 'Download Data')
)
)
)
)
library(shiny)
library(shinydashboard)
#server start
function(input, output) {
testinput<- reactive({
if(is.null(input$file1))
return ()
else
{
nfiles = nrow(input$file1)
csv = list()
for (i in 1 : nfiles)
{
csv[[i]] = read.csv(input$file1$datapath[i])
}
csv_names <- input$file1$datapath
mydata <- do.call(rbind, lapply(csv_names, function(x) cbind(read.csv(x), name=strsplit(basename(x),'\\.')[[1]][1])))
mydata
}
})
output$plot.pdf <- downloadHandler(
filename = function() {
"plot.pdf"
},
content = function(file) {
withProgress(message = 'Your file is downloading',
detail = 'This may take a minute or two...', value = 0, {
for (i in 1:10) {
incProgress(1/10)
Sys.sleep(0.5)}
pdf(file)
plot(testinput()[,1])
dev.off()
})
}
)
}
|
sprintf runs locally, but breaks on shinyapps.io server
By : user2325051
Date : March 29 2020, 07:55 AM
Does that help Wow, what's your R version? This works for me on R 3.4, but not R 3.2 or 3.5. code :
# R 3.4.3
R.version.string
## [1] "R version 3.4.3 (2017-11-30)"
sprintf("%05.2#f", 123)
## [1] "123.00"
# R 3.2.3
R.version.string
## [1] "R version 3.2.3 (2015-12-10)"
sprintf("%05.2#f", 123)
## [1] "%05.2#f"
# R 3.5.0
R.version.string
## [1] "R version 3.5.0 (2018-04-23)"
sprintf("%05.2#f", 123)
## [1] "%05.2#f"
sprintf("%#05.0f", 123)
## [1] "0123."
|
Shiny App works locally, but not on the ShinyApps.io server
By : Zoe
Date : March 29 2020, 07:55 AM
it helps some times I guess you have your library() calls in your code as they are missing above. Anyway, I believe you are missing the info about the host/port/user/password for the database you want to connect to. See https://github.com/r-dbi/RPostgres.
|
Shiny app that fetches data via URL works locally but not on shinyapps.io
By : Andy
Date : March 29 2020, 07:55 AM
like below fixes the issue I posted this question on multiple boards, and Joshua Spiewak on the Shinyapps.io Users Google group solved my problem:
|