Access/use R console when running a shiny app

后端 未结 3 637
我寻月下人不归
我寻月下人不归 2021-02-19 04:06

Does anybody know if one is able to access the R console when running a shiny app? (running the shiny application in background would also be helpful, if that\'s possible)

3条回答
  •  礼貌的吻别
    2021-02-19 04:25

    Can't you use the <<- global assignment operator? I'm not sure how complicated the variable you need to set is, but say you just need to change some variable t to 5.

    We could make a textBoxInput that changes the input$new_t variable. Then have an observer:

    observeEvent(input$new_t, t <<- input$new_t)
    

    Then, when input$new_t changes, the global variable t changes.

    Edit: Another option is to put a browser() in the object that accesses the variable you need to change, right before the variable is accessed.

提交回复
热议问题