R 如何使我的作业的端口以闪亮的方式运行?

R 如何使我的作业的端口以闪亮的方式运行?,r,shiny,shiny-server,R,Shiny,Shiny Server,我有一个闪亮的应用程序在后台运行这个命令 library(rstudioapi) #Run shiny app in the background jobRunScript("Tree/working/shiny-run.R", "Tree", exportEnv = "R_GlobalEnv") #Relative Path # See the tree in the viewer window of RStudio rstu

我有一个闪亮的应用程序在后台运行这个命令

library(rstudioapi)

#Run shiny app in the background

jobRunScript("Tree/working/shiny-run.R", "Tree", exportEnv = "R_GlobalEnv") #Relative Path 

# See the tree in the viewer window of RStudio
rstudioapi::viewer("http://localhost:3522")

我的问题是每次运行jobRunScript()时都会收到以下消息

Listening on http://127.0.0.1:3522
每次运行作业时,端口都在更改,以便能够使用此功能

rstudioapi::viewer("http://localhost:3522")
因为用户需要更改作业给定的端口


是否可以建立一个端口来运行作业?或者,如何获取此端口以及传递给函数查看器()的权限?

这是否回答了您的问题?