Skip to content

How to set default port number for app? #449

Answered by kamilzyla
dereckmezquita asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @dereckdemezquita! Thanks for using Rhino and for asking 🙂 Two approaches come to my mind:

Set options in .Rprofile

Add these lines to the .Rprofile file in your project:

options(
  shiny.port = 3003,
  shiny.launch.browser = TRUE
)

After restarting your R session, you can launch the app as usual by running shiny::runApp() in the R console or via "Run app" button (on the app.R file) in RStudio.

Create a launch script

Create a run.R script with the following content:

shiny::runApp(
  port = 3003,
  launch.browser = TRUE
)

You can then launch the app by sourcing this script in your R console (source("run.R")). If you're on Linux / macOS, you can also make the script executable:

  1. Put #!/u…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@shahreyar-abeer
Comment options

Answer selected by PawanRamaMali
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants