I am new to shiny. I have ui and server file. I have packaged my R code, portable R and portable chrome into an executable. I want to distribute the executable to others. How can I hide the R code in ui.r and server.r files?
I want to distribute as desktop app as exe file. So that user should be able to run by just clicking the executable.
Related
I've created a single R file 'myfile.R' which is composed of several functions, reading from an odbc connection, and of course the ui and server components for the shiny application. The goal is for the user to treat this as an executable, that is, I'd like them to be able to run this app without having to run Rstudio. Currently on this environment, Rstudio is installed (as are the relevant packages), what I'm currently writing in command line is:
Rscript myfile.R
The file looks to be successfully loaded, but the application itself does not 'pop up' towards me, infact nothing does, it just says that it is listening on http....
I was thinking of creating a bash script that could do this, and this seemed to be the most simple approach but this is not working.
I have a basic shiny app (ui.r and server.r) that I am able to run in RStudio.
But seems like I can't run it in IntelliJ.
I have installed the R language support plug-in and I can run r scripts.
But when I try to run ui.r, the only thing I get is html output in the console.
Does anyone recognise this? I probably forgot to configure something?
I do have experience running java (web) apps with IntelliJ. With tomcat setup e.g.
In the run configurations, I didn't see anything specific for a shiny server or something R related. So I guess that is not where I should search ...
Any idea? Is more information needed?
Thx in adavance.
edit:
The answer is here: https://youtrack.jetbrains.com/issue/R-895
To run a shiny App (R framework) on PyCharm you must enable R first and indicate where is the R interpreter located:
R options appears on the bar status. One of them is R Console. Click on it. Write getwd() command to see if you are in the root directory of the project. If not, set it with setwd() command:
Next, write runApp() and DO NOT press enter yet. You must press alt+enter and then click on load Shiny:
While developing a modular Shiny app (with multiple .R files that are sourced by global.R) in RStudio I have to repeatedly
switch to ui.R or server.R
click Run App
click Stop
navigate back the R file I'm working on
Doing this many times is a pain as I hardly work on ui.R or server.R files directly. I've looked for a keyboard shortcut for Run App here to no avail.
Typing runApp() in the Console is a workaround. Anything better?
If your question is just for a shortcut for Run App, ctrl + shift + enter (on windows) works in server.R, ui.R, and app.R files.
Edit: In RStudio you can also use ctrl+f9 and ctrl+f10 to navigate across open tabs and then use ctrl+shift+enter to execute.
I'm using R 3.2 and Rstudio 0.98.953
Just installed shinyapps and shiny, and the RUN APP button showed up (some people say it will only appear in preview version of Rstudio 0.99)
But the RUN and SOURCE botton disappeared. Any way I can get them back? Thanks!
Is the currently open file a file in a Shiny app? If RStudio detects that you're in a Shiny app (the file you're viewing is ui.R or server.R or app.R etc.) then it automatically lets you run the shiny app instead of "run the code" because that's the correct thing to do. When you switch to a different file that's outside of a shiny folder, it should go back to normal.
If you're not inside a Shiny app and it's showing "Run App", then you should file a bug with RStudio
I made a GUI using R, and I wanted to make an executable file for it, so other people can double click and launch the GUI without seeing any R code. I made a .bat file and have Rscript run my R code, but what happened is that the GUI is created and then closed, so I cannot interact with the GUI at all. So I want
to ask for any suggestion on how to make the GUI stay open until I close it? Or any other ways to make an executable file? Thanks!
BTW, I am using windows 7.