【发布时间】:2021-03-17 23:35:30
【问题描述】:
我已经拼命尝试部署我的 shinyApp 大约一个星期了,但不幸的是我无法停止收到以下消息:
Warning message: Error detecting locale: Error in read.table(file = file, header = header, sep = sep, quote = quote, : incomplete final line found by readTableHeader on 'raw' (Using default: en_US)
我查看了debugging Shiny app page,并使用了“展示模式”来尝试追踪脚本中的潜在问题。但是当我在本地运行“展示模式”代码 (shiny::runApp(display.mode="showcase")) 时,我会收到以下警告消息:
Warning: Error in file.path: cannot coerce type 'closure' to vector of type 'character'
正如 YBS 在 cmets 中解释的那样,这个错误实际上是一个闪亮的错误,但是我看不到如何调试我的脚本以部署我的应用程序(我已经尝试在末尾添加一个空行我的每个 csv 文件,但它没有帮助)
有人已经遇到过这个问题吗?
我的应用:https://gitlab.com/wanderzen/shiny_app/-/blob/master/ZABR.rar
注意:如果我使用 shinyApp(ui, server) ,我的应用程序在本地运行起来就像魅力一样
以下是关于我的会话的一些信息:
# sessionInfo()
R version 4.0.0 (2020-04-24)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 18363)
Matrix products: default
locale:
[1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252
[4] LC_NUMERIC=C LC_TIME=French_France.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] sp_1.4-1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.4.6 BiocManager_1.30.10 compiler_4.0.0 pillar_1.4.4
[5] later_1.0.0 tools_4.0.0 packrat_0.5.0 digest_0.6.25
[9] jsonlite_1.6.1 tibble_3.0.1 lifecycle_0.2.0 lattice_0.20-41
[13] pkgconfig_2.0.3 rlang_0.4.9 shiny_1.4.0.2 rstudioapi_0.11
[17] curl_4.3 xfun_0.13 fastmap_1.0.1 dplyr_0.8.5
[21] htmlwidgets_1.5.1 vctrs_0.3.0 askpass_1.1 grid_4.0.0
[25] DT_0.16 tidyselect_1.1.0 glue_1.4.1 R6_2.4.1
[29] purrr_0.3.4 magrittr_1.5 promises_1.1.0 ellipsis_0.3.1
[33] htmltools_0.5.0 rsconnect_0.8.16 assertthat_0.2.1 mime_0.9
[37] xtable_1.8-4 httpuv_1.5.2 tinytex_0.23 openssl_1.4.1
[41] crayon_1.3.4
# packageVersion("shiny")
[1] ‘1.4.0.2’
【问题讨论】:
-
尝试将名为
subset的响应式对象更改为subset1。 -
其实这可能是shiny中的一个bug。请参阅here
-
感谢 YBS 的回答!这似乎确实是一个错误......在那种情况下,当我尝试部署我的应用程序时,我看不到任何方法来检查我的脚本的哪一部分可能导致第一条错误消息:/我已经尝试过一切(例如: stackoverflow.com/questions/22171858/…)
-
如果您关注community.rstudio.com/t/…,...如果您升级到最新的闪亮版本,问题可能会得到解决。正如所见,您在本地没有最新版本的闪亮包。因此,部署服务器上的闪亮包也可能不是最新的。您可以尝试使用
install.packages("shiny")更新部署服务器上的软件包,或者使用remotes::install_github("rstudio/shiny")甚至更好地使用最新的开发版本 -
如果读取 csv 有问题,请尝试将其转换为 rds 格式,然后改为读取。
标签: r shiny shiny-server shinyapps