0

I am running a app.r script written by one of my ex colleague and he left the company quite a while back.

In order for me to open the app , I will have to type these 3 commands into Rstudios console before I can use the runApp/shiny::runApp() function.

  1. library(devtools)
  2. document()
  3. options(shiny.launch.browser = .rs.invokeShinyWindowExternal)

I would like to ask if there is any code that I could add into my colleague's app.R

I am trying to reduce the number of console code I have to type remove the need to do so before i use the runApp/shiny:runApp() function

Thanks in Advance.

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
Jun Jie
  • 1
  • 1
  • What if you create another script that has these 4 commands in, and just run that? If you're on linux, this is fairly straightforward by running `Rscript ./scriptname.R`. – Roman Luštrik Jul 07 '22 at 05:39
  • Thank you for replying~ I am trying to run this on windows OS. Is there an alternative solution other than creating another script and run it? – Jun Jie Jul 07 '22 at 06:10
  • There are, but i wouldn't consider them "clean", like modifying the `.Rprofile` file. – Roman Luštrik Jul 07 '22 at 08:14
  • Ill give this a go and see if i can make it easier for other users in my lab to follow the instructions. Thanks for the replies haha Actually , could you give me a direction on where could I learn about modifying the Rprofile and adding these commands line in the file to get it working? – Jun Jie Jul 07 '22 at 09:04
  • If you're really serious about distributing the shiny app (but not willing to host it, not even internally), you might want to have a look at Docker and how you can use it to package a shiny app (and possibly data). As for the .Rprofile editing, have you tried searching the internet or seen [this](https://stackoverflow.com/questions/46819684/how-to-access-and-edit-rprofile)? – Roman Luštrik Jul 10 '22 at 11:16
  • 1
    Apologies , I am rather new to R language and I have only recently read about Rprofiling. I am grateful to receive your reply and will have a look at your link and check more about profiling of R online . Thanks again – Jun Jie Jul 12 '22 at 01:42

0 Answers0