如何在本地闪亮服务器中提供生成闪亮应用程序的R代码

时间:2017-06-08 05:02:30

标签: r shiny

我有以下R代码( BatchQC package

 library(BatchQC)
    nbatch <- 3
    ncond <- 2
    npercond <- 10
    data.matrix <- rnaseq_sim(ngenes=50, nbatch=nbatch, ncond=ncond, npercond=
        npercond, basemean=10000, ggstep=50, bbstep=2000, ccstep=800, 
    basedisp=100, bdispstep=-10, swvar=1000, seed=1234)
batch <- rep(1:nbatch, each=ncond*npercond)
condition <- rep(rep(1:ncond, each=npercond), nbatch)
batchQC(data.matrix, batch=batch, condition=condition, 
        report_file="batchqc_report.html", report_dir=".", 
        report_option_binary="111111111",
        view_report=FALSE, interactive=TRUE, batchqc_output=TRUE)

在RStudio控制台中运行时,会生成以下内容:

enter image description here

我的问题是如何通过我的本地Shiny Server

显示该网站
/srv/shiny-server/

2 个答案:

答案 0 :(得分:1)

你对本地闪亮服务器的意思是什么?当你从R本地运行预览时已经是本地的。 如果您的计算机上安装了完整的服务器,只需在示例应用程序中创建一个文件夹,然后将浏览器指向闪亮的服务器(通常为http://127.0.0.1:3838/sample-apps/youfolder/

答案 1 :(得分:1)

我不熟悉BatchQC软件包,但假设它是this one on GitHub,我查看了while (1 == 1) { DateTime dtNowTime = DateTime.Now; if (dtNowTime.Hour == 18 && dtNowTime.Minute == 30) { int status = 0; status = sending.HelloWorld(); if (status == 1) { Response.Write("<script>alert('Success');</script>"); } else { Response.Write("<script>alert('Fail');</script>"); } } } 函数,看到了这段代码:

batchQC

所以,我不知道这是否有效(我自己无法安装该软件包),但您可以尝试在闪亮的服务器中创建 appDir <- system.file("shiny", "BatchQC", package = "BatchQC") if (appDir == "") { stop("Could not find shiny directory. Try re-installing BatchQC.", call. = FALSE) } shiny::runApp(appDir, display.mode = "normal") 文件有以下几行:

app.R

不能保证它能够正常运作,但要试一试。

相关问题