【问题标题】:Error in shinytest. Cannot detect my script is a R file闪亮测试中的错误。无法检测到我的脚本是 R 文件
【发布时间】:2020-05-27 01:58:18
【问题描述】:

我正在尝试使用函数 shinytest 测试一个闪亮的应用程序。 我做了记录并得到一个新文件: The picture show my test file and how I have specified the path to my application

当我尝试运行应用程序时,我收到以下错误: is_rmd(path) 中的错误: 未知 app 是普通 Shiny 应用还是 .Rmd:C:/Users/LUCBA/Projects/markt_to_marketpricingtool/test/myshinyapp.R

我知道该文件是一个 R 文件,但我还是得到了错误。

为什么会发生这种情况,我可以做些什么来解决它?

最好的卢卡斯

【问题讨论】:

  • 显示代码图片不如仅在问题中粘贴代码有用。您似乎正在显示test_1.R 的内容。 myshinyapp.R 到底是什么?

标签: r file error-handling shiny


【解决方案1】:

这是导致卢卡斯原始问题出错的代码

app <- ShinyDriver$new("C:/Users/LUCBA/Projects/markt_to_marketpricingtool/test/myshinyapp.R")

问题在于shinytest::ShinyDriver$new 的第一个(path)参数只能是一个目录(包含一个app.R 文件一个server.R/ui.R 对)或 R 降价 .Rmd 文件。遗憾的是,Shiny 应用文件不能直接指定名称,因此不能命名为myshinyapp.R

【讨论】:

    猜你喜欢
    • 2022-06-30
    • 1970-01-01
    • 1970-01-01
    • 2015-12-24
    • 1970-01-01
    • 1970-01-01
    • 2021-02-09
    • 2020-02-06
    • 2021-12-16
    相关资源
    最近更新 更多