R Shiny DesktopDeployR停止日志记录错误 [英] R Shiny DesktopDeployR Stop Logging Error

查看:411
本文介绍了R Shiny DesktopDeployR停止日志记录错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将R Shiny App部署为Windows桌面应用程序。到目前为止,我已经使用了 http: //blog.analytixware.com/2014/03/packaging-your-shiny-app-as-windows.html ,并设法使其在Stackoverflow用户的帮助下工作(问题名称R Shiny as Windows Desktop应用程序创建带有警告的文本​​文件)。

I am trying to deploy R Shiny App as an Windows Desktop App. So far I have used the framework described at http://blog.analytixware.com/2014/03/packaging-your-shiny-app-as-windows.html and managed to make it work with the help of stackoverflow users (question name "R Shiny as Windows Desktop App Creates Text File With Warning").

此框架的更新已经开发出来,它比以前有几个优点,如不依赖于Google Chrome浏览器等等,其描述如下: http://oddhypothesis.blogspot.com/2016 /04/desktop-deployr.html
所有文件可以在框架创建者的GitHub帐户中找到(链接在说明中显示)

An update to this framework has been developed and it has several advantages over the previous one, such as not relying on Google Chrome browser etc. and it is described here: http://oddhypothesis.blogspot.com/2016/04/desktop-deployr.html All files can be found in the GitHub account of framework creator (link is presented in the description)

我已经调整了以下内容:

I have adjusted the following:

app.R

require(shinyjs,quietly = TRUE,warn.conflicts=FALSE)
require(markdown,quietly = TRUE,warn.conflicts=FALSE)
require(scales,quietly = TRUE,warn.conflicts=FALSE)
require(DT,quietly = TRUE,warn.conflicts=FALSE)
runApp("./app/shiny/", launch.browser=TRUE,quiet=TRUE)

packages.txt

添加了我使用的包的名称

Added the names of the packages I am using

    # Primary package dependencies for the application that are loaded during
    # startup.
    #
    # If not available, they will be installed into app/library.  Custom source
    # packages need to be installed manually.

    # bare miniminum: configurations are stored in json format
    jsonlite

    # if deploying shiny based applications:
    shiny
    shinyjs
    markdown
    scales
    DT

应用程序启动,它的工作原理。但是,创建一个名为 log 的文件夹,其中包含文件 error.log ,其中包括以下内容:

App does launch, it works. However a new folder is created called log with file error.log, which includes the following:

library paths:
... C:/Users/VoronecI/Desktop/New folder (2)/app/library
... C:/Users/VoronecI/Desktop/New folder (2)/dist/R-Portable/App/R-Portable/library
working path:
... C:/Users/VoronecI/Desktop/New folder (2)
Loading required package: methods
ensuring packages: jsonlite, shiny, shinyjs, markdown, scales, DT

Attaching package: 'shiny'

The following object is masked from 'package:jsonlite':

    validate


Attaching package: 'shinyjs'

The following object is masked from 'package:shiny':

    runExample

The following objects are masked from 'package:methods':

    removeClass, show


Attaching package: 'DT'

The following objects are masked from 'package:shiny':

    dataTableOutput, renderDataTable

有没有办法防止这种记录的无意义的错误?
我想要摆脱它的原因是因为我进一步使用Inno Setup Compiler 来创建 .exe ,当我有一个日志时这不工作文件更新每次我运行的应用程序。

Is there a way to prevent this logging of the unmeaningful error? The reason why I want to get rid of it is because I further use Inno Setup Compiler to create .exe and this is not working when I have a log file updating each time I run the app.

推荐答案

正如你可以看到在这个文件(第66行) https://github.com/wleepang/DesktopDeployR/blob/7c81e72c5beb29bf84ca65fd1d5bb5486caec51a/ dist / script / wsf / js / run.js

As you can see in this file (line 66) https://github.com/wleepang/DesktopDeployR/blob/7c81e72c5beb29bf84ca65fd1d5bb5486caec51a/dist/script/wsf/js/run.js

该命令以

var strCommand = [Rexe, Ropts, RScriptFile, "1>", Outfile, "2>&1"].join(" ");

它将命令行输出(通常直接打印到屏幕)重定向到 OUTFILE 。您可以将此行更改为

which redirects command line outputs (that normally directly print to the screen) to the Outfile. You can change this line to

var strCommand = [Rexe, Ropts, RScriptFile].join(" ");

这将禁用日志记录。这可能有其他的影响(你可能会看到一个命令窗口,例如,我不太确定,但测试它)。

which will disable the logging. This might have other implications though (you might see a command window for example, I am not too sure but test it out).

或者,你可能可以改变该文件 https://github.com/wleepang/DesktopDeployR/blob/7c81e72c5beb29bf84ca65fd1d5bb5486caec51a /app/config.cfg (第27行)并设置

Alternatively, you might be able to change this file https://github.com/wleepang/DesktopDeployR/blob/7c81e72c5beb29bf84ca65fd1d5bb5486caec51a/app/config.cfg (line 27) and set

    - use_userprofile: true

(你需要取消注释这一行,它目前在一个块注释中)。这将确保日志文件进入用户配置文件文件夹,这也可能会解决您的问题。

(you need to uncomment this line, it is currently inside a block comment). This will make sure the log file goes into the user profile folder, and that might also solve your problem.

这篇关于R Shiny DesktopDeployR停止日志记录错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆