【问题标题】:ERROR: shinyjs: Error parsing the JavaScript code provided错误:shinyjs:解析提供的 JavaScript 代码时出错
【发布时间】:2017-03-24 20:01:42
【问题描述】:

我正在尝试通过 Windows 中的批处理文件运行闪亮的仪表板。这是我的run.r 文件的样子

require(shiny)
require(shinyjs)
folder_address = 'E://Dash'
runApp(folder_address, launch.browser=TRUE)

这是我的batch file 的样子

"C:\Program Files\R\R-3.3.1\bin\R.exe" -e "shiny::runApp('E:/Dash', launch.browser=TRUE)"

但是,每当我运行批处理文件时,它都会打开浏览器并抛出此错误

ERROR: shinyjs: Error parsing the JavaScript code provided.

【问题讨论】:

    标签: r shiny


    【解决方案1】:

    要从 Windows 中的批处理文件运行位于 E:\Dash 的闪亮应用程序:

    1. 你可以在R中获取运行这个函数的库文件夹:

      .libPaths()
      "C:/Users/me/Documents/R/R-3.3.1/library"
      
    2. 你的 run.R 应该是:

      require(shiny)
      folder_address = 'E:/Dash'
      runApp(folder_address, launch.browser=TRUE)
      
    3. 你的 run.BAT 应该是:

      "C:\Program Files\R\R-3.3.1\bin\Rscript.exe" E:/Dash/run.R R_LIBS="C:/Users/me/Documents/R/R-3.3.1/library"
      

    【讨论】:

    • 看不懂路径R_LIBS
    猜你喜欢
    • 2015-10-23
    • 2011-08-11
    • 1970-01-01
    • 2012-12-31
    • 2019-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多