possible to run RShiny app without opening an R environment?

后端 未结 7 1139
一个人的身影
一个人的身影 2021-01-30 05:45

Currently I have a R shiny app, to run it I open up RStudio and execute

setwd(\"C:/Users/Me/Desktop/R/ShinyProject2\")
library(shiny)
......
runApp()
         


        
7条回答
  •  失恋的感觉
    2021-01-30 06:07

    You can now use the RInno package for this type of thing. To get setup:

    install.packages("RInno")
    require(RInno)
    RInno::install_inno()
    

    Then you just need to call two functions to setup an installation framework:

    create_app(app_name = "myapp", app_dir = "path/to/myapp")
    compile_iss()
    

    If you would like to include R, add include_R = TRUE to create_app:

    create_app(app_name = "myapp", app_dir = "path/to/myapp", include_R = TRUE)
    

    It defaults to include shiny, magrittr and jsonlite, so if you are using other packages like ggplot2 or plotly, just add them to the pkgs argument. You can also include GitHub packages to the remotes argument:

    create_app(
        app_name = "myapp", 
        app_dir  = "path/to/myapp"
        pkgs     = c("shiny", "jsonlite", "magrittr", "plotly", "ggplot2"),
        remotes  = c("talgalili/installr", "daattali/shinyjs"))
    

    If you are interested in other features, check out FI Labs - RInno

提交回复
热议问题