I want to create a shiny app interpolating weather data. When I try to access my data inside a reactive expression I always get as a result NULL. I don't know where I am wrong. I tried to imitate my problem as simple as possible. Here we go:
My datatable:
lon lat Temperature AirPressure
50.0 25.0 12.1 1012.0
51.0 26.0 13.4 1011.0
name of the datatalbe: myDataTable
My ui.R:
selectInput(inputId = "getData",
label = "used Data:",
choices = c("Temperature","AirPressure"),
selected = "Temperature"
)
Inside my reactive expression I want to access the data depending on what is selected. Now when I do the following:
1. Test
print(myDataTable$Temperature)
Result (as expected): [1] 12.1 13.4
2. Test
print(myDataTable$input$getData)
Result (not as expected): NULL
3. Test
tempVal <- input$getData
print(tempVal)
print(myDataTable$tempVal)
Result (not as expected):
[1]Temperature
NULL