Opening Shiny App directly in the default browser
To run it using different approach to @Batanichek you can locate the executables of each of your browsers and then specify it in options which to point to, as so:
Edit:
You can find the options
and its arguments in the R environment (I used RStudio) e.g. options(browser = )
Step 1: Locate where your .exe files are installed for all you browsers, then add the following:
For Chrome
options(browser = "C:/Program Files/Google/Chrome/Application/chrome.exe")
For Firefox
options(browser = "C:/Program Files/Mozilla Firefox/firefox.exe")
For IE
options(browser = "C:/Program Files/Internet Explorer/iexplore.exe")
Step 2: Run the app as always
runApp(list(ui = ui, server = server),host="192.168.xx.xx",port=5013, launch.browser = TRUE)
shiny not opening in browser from RStudio
There is a dropdown menu in RStudio, right next to Run App button, change it to Run External.
Or we can set launch.browser:
runApp(launch.browser = TRUE)
launch.browser If true, the system’s default web browser will be
launched automatically after the app is started. Defaults to true in
interactive sessions only. This value of this parameter can also be a
function to call with the application’s URL.
Shiny: Choose whether to run app in Window, in Viewer Pane or Externally
I was able to resolve my issue with this code:
# Create ui and server
# Set Rstudio to run external
shinyApp(ui = ui, server = server) # runs externally
options(shiny.launch.browser = .rs.invokeShinyWindowViewer)
shinyApp(ui = ui, server = server) # runs in RStudio window
possible to run RShiny app without opening an R environment?
RStudio != R
There is a simple command-line interface to R, which you can run on Windows by running R.exe in the bin folder of your R installation.
There's also Rscript.exe, which can run an expression or a script file. For example:
C:\Program Files\R\R-2.15.2\bin\RScript -e hist(runif(1000))
will (given the right paths) create a PDF file with a histogram in it.
So,
- your co-worker needs an R installation
- you need that installation to have all the packages to run shiny
- or you add a bunch of install.packages() lines to your code
- you need to give them a folder with your shiny code
- you add a windows .BAT file for them to click
- they run that, it calls Rscript.exe which starts the shiny package you gave them
Or get it hosted on the RStudio guys' public shiny server, but then we can all see it.
Related Topics
Non-Equi Join Using Data.Table: Column Missing from the Output
Using Lists Inside Data.Table Columns
How to Update R Packages in Default Library on Windows 7
Perform a Semi-Join with Data.Table
Count Number of Zeros Per Row, and Remove Rows with More Than N Zeros
Converting Two Columns of a Data Frame to a Named Vector
Is Set.Seed Consistent Over Different Versions of R (And Ubuntu)
Dplyr - Using Column Names as Function Arguments
Making a Stacked Bar Plot for Multiple Variables - Ggplot2 in R
How to Remove Empty Factors from Ggplot2 Facets
Finding Point of Intersection in R
Starting a Daily Time Series in R
R Split Numeric Vector at Position
Gsub() in R Is Not Replacing '.' (Dot)
What Can R Do About a Messy Data Format
Why Is As.Date Slow on a Character Vector
Detecting Operating System in R (E.G. for Adaptive .Rprofile Files)