当我从
现在,如果我通过
此时,我可以将浏览器指向
cmd
命令行启动运行shiny
应用的R
脚本时,似乎会启动两个Rscript.exe
实例?我总是可以关闭其中较小的一个而应用程序仍然可以继续运行。有人能详细说明一下幕后发生了什么,或者告诉我我做错了什么导致出现双重进程吗?
super_simple.R
require(shiny)
app <- shinyApp(
ui = bootstrapPage(
numericInput('n', 'Number of obs', 100),
plotOutput('plot')
),
server = function(input, output) {
output$plot <- renderPlot({ hist(runif(input$n)) })
}
)
runApp(app, launch.browser = FALSE, port = 1234, host = "10.123.4.56")
现在,如果我通过
cmd
命令行启动它:START Rscript --vanilla C:\Users\Jason\Projects\super_simple.R
此时,我可以将浏览器指向
http://10.123.4.56:1234
并查看该应用。但是,如果我通过以下方式查看正在运行的进程:tasklist /FI "imagename eq rscript*"
,我会看到两个 Rscript.exe
进程:
我已经确定的是,我总是可以杀掉其中较小的一个(例如,taskkill /pid 9360 /f
),但应用程序仍然完整地运行?注意:我尝试通过 START \b ...
在后台启动命令,但结果相同。
runApp
则为应用程序本身创建第二个实例。 - Martin Schmelzer