How to use R code that creates a Shiny application on a local shiny server

I have the following R code from ( 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) 

When launched in the RStudio console, this produces the following:

enter image description here

My question is how can I display this site through the local Shiny Server

 /srv/shiny-server/ 
+5
source share
2 answers

what do you mean on a local brilliant server? when you start a preview from R that already exists. if your computer has a complete brilliant server installation installed, just create a folder in the sample applications, and then point the browser to the brilliant server (usually http://127.0.0.1:3838/sample-apps/youfolder/

+1
source

I am not familiar with this BatchQC package, but assuming it is this one on GitHub , I looked at the batchQC function and saw this code:

  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") 

So, I don’t know if this will work or not (I myself could not install the package myself), but you can try to create the app.R file on your shiny server with the following lines:

 appDir <- system.file("shiny", "BatchQC", package = "BatchQC") shiny::runApp(appDir) 

There is no guarantee that this will work, but try.

+1
source

Source: https://habr.com/ru/post/1268649/


All Articles