Simply question: Is it possible for a Shiny app to be launched in the same browser target window as the previous instance. It becomes quite annoying to have to close all test run windows after a while. I've tried to set a fixed port, but that didn't help.
Related
I usually close a Shiny App by x-ing out of the App's window as shown in the 1st image below. Depending on the App, sometimes this doesn't stop the App so I then go to the R studio console and click on "Stop" as shown in the 2nd image below. Sometimes this doesn't stop the App either, and R shuts down and restarts after a warning window pops up asking me if I want to restart R: clicking "No" doesn't stop the runaway App, so the only way I know how to stop the App is to click "Yes" and restart.
Why is this happening and how do I fix this?
As far as I can tell the Apps where this happens are bug-free, in the sense they work fine for me and I got no other errors messages or warnings.
1st image, how I normally stop an App:
2nd image, where I go on R Studio console to stop a runaway App:
I have a Desktop Entry that calls a shiny app.
Here's my desktop entry
[Desktop Entry]
Type=Application
Comment=App
Name=App
Exec=/usr/bin/Rscript -e "shiny::runApp('~/raspberry_IP/app.R', launch.browser=TRUE)"
Icon=/home/path/to/logo/rpi_logo.png
Terminal=false
Categories=Utility
StartupNotify=true
This runs well and the Shiny application works as expected. However, when I close my browser tab, I see the process is still running.
I am running this application from Ubuntu 20.04 LTS.
If I change my terminal=false to terminal=true. I see that the output of my terminal freezes (the app no longer updates, hence no diagnostic printing). But the terminal is still active (which makes sense given the process is still running). I can CTRL+C out of it to kill it from my terminal, but that's not the desired user behavior.
I see some strategies to stop the app using stopApp() like here. This strategy uses a separate action button to kill the app, so the user has to "manually" stop it. This might work, but I believe it's natural for the user to try to close the tab or Browser (and there's no way for them to know the process is still running, unless they check).
Using this on the server side, does kill the process, but it's recommended against (see here).
session$onSessionEnded(stopApp)
In this case, because my app is running on a local machine, I think I could potentially get away with this (there is only one user at a time), but I was wondering whether there's better practice to implement.
I am currently working developing a shiny app that process a lot of heavy bayesian models. We are facing the following problem:
Our app suddenly closes if we try to run it in the rstudio browser or google chrome but apparently it is not a code problem since we can run the app on internet explorer, anyone had ever faced such issue?
source code: https://rstudio.cloud/project/413282
If we just run shiny::runApp() it opens a new window with the app, after 3 min (aprox) the new window closes but according to the console it is still running with no errors
Or to ask the question in a different way: Can you run shiny apps in the background without the app being explicitly accessed by a browser.
My use case. I would like to refresh a data file stored on the hard disk every day. To do this, I can use invalidateLater(). However, do I explicitly need to have this app open in a browser window for it to work? Do I have to initialise the app by opening it in a browser window for it to work?
Every time i compile or run, the flex builder opens a browser showing the output... is there anyway we can destory the older window when newer ones open... i mean a setting in flex.
no. but i think if your pressing debug test and that opens a new browser and starts debugging your app, when you hit stop on the debugging, the app will terminate and close the browser as well. this if the debugging app is the only tab you have opened in the browser. other than that, you can't really do anything about it.
If you have flex builder set up to build automatically then you just need to save the file that you have changed and then when flex have finished building (you can see the status down in the right corner of the screen) reload your browser.
That is pretty much the workflow i have when i develop in flex. This way i only get new browser windows opened when i debug.