Call Variable from reactive data() in R Shiny App

前端 未结 2 632
慢半拍i
慢半拍i 2021-01-12 19:31

I would like to call a certain variable within a reactive expression. Something like this:

server.R

library(raster)

shinyServer(fun         


        
2条回答
  •  隐瞒了意图╮
    2021-01-12 20:16

    "With data()$asc_new1 you wont be able to access the in the reactive context created variables (at least with the current shiny version). You need data()[1] data()[2] if you put it in a list like MadScone. Calling it with the $ sign would raise

    Warning: Unhandled error in observer: $ operator is invalid for atomic vectors

    However, the error your getting

    Error in data()$fitnew : $ operator not defined for this S4 class

    is not only because you access the variable wrong. You named the output of your reactive function data which is reserved name in R. You want to change that to myData or something.

提交回复
热议问题