Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Shiny path to root folder?

I have not installed a Shiny server and I would prefer that I did not. When I run runApp from RStudio I have a browser window opened at address localhost:port. I would like this application to read data from disk. At which path do I need to place this data in order for the client (index.html) to be able to do window.open(path/data) and a new window would open showing the raw data?

I have in index.html

Shiny.addCustomMessageHandler ("callbackHandler",
    function (value)
    {
        window.open(value.file);
    });

and in server.R

session$sendCustomMessage (type = "callbackHandler", message = list (file = trackfile, ...));
like image 684
gaitat Avatar asked Mar 23 '26 14:03

gaitat


1 Answers

runApp doesnt serve files. It listens on the given port and serves the one app on that port. Files can be accessed from the server side at www and made accessible to the ui etc.

If you want to have files served you will need to have a seperate http server running like python simplehttpserver or servr github.com/yihui/servr or the R rook package.

like image 55
jdharrison Avatar answered Mar 25 '26 08:03

jdharrison



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!