【发布时间】:2021-04-23 13:44:05
【问题描述】:
这个问题让我很震惊。让一个最小的可重现示例:
-
在 RStudio 上,创建一个新项目...选择 Shiny Web App。检查示例应用是否运行良好。
-
在标准 R 文件夹中创建,以放置所有 *.R 脚本。
-
在 R 文件夹中创建一个失败的虚拟脚本,但您还不想运行。例如
str(do_not_exist) ## foo.R
4.再次运行应用程序。现在,应用程序失败了
> runApp()
Error in str(do_not_exist) : objeto 'do_not_exist' no encontrado
为什么 Shiny 运行不受欢迎的脚本?它们在根目录之外。 我没有找到方法来保存不是项目中的函数的脚本。
这是我的 R 会话
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19042)
Matrix products: default
locale:
[1] LC_COLLATE=Spanish_Argentina.1252 LC_CTYPE=Spanish_Argentina.1252
[3] LC_MONETARY=Spanish_Argentina.1252 LC_NUMERIC=C
[5] LC_TIME=Spanish_Argentina.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] tidyr_1.1.3 dplyr_1.0.5 openxlsx_4.2.3.9000 shiny_1.6.0
loaded via a namespace (and not attached):
[1] Rcpp_1.0.6 magrittr_2.0.1 tidyselect_1.1.0 xtable_1.8-4
[5] R6_2.5.0 rlang_0.4.10 fastmap_1.1.0 fansi_0.4.2
[9] tools_4.0.5 utf8_1.2.1 DBI_1.1.1 withr_2.4.2
[13] htmltools_0.5.1.1 ellipsis_0.3.1 assertthat_0.2.1 digest_0.6.27
[17] tibble_3.1.1 lifecycle_1.0.0 crayon_1.4.1 zip_2.1.1
[21] purrr_0.3.4 later_1.1.0.1 vctrs_0.3.7 promises_1.2.0.1
[25] glue_1.4.2 mime_0.10 stringi_1.5.3 compiler_4.0.5
[29] pillar_1.6.0 generics_0.1.0 httpuv_1.5.5 pkgconfig_2.0.3
【问题讨论】: