リアクティブ式内で特定の変数を呼び出したいと思います。このようなもの:
サーバー.R
library(raster)
shinyServer(function(input, output) {
data <- reactive({
inFile <- input$test #Some uploaded ASCII file
asc <- raster(inFile$datapath) #Reads in the ASCII as raster layer
#Some calculations with 'asc':
asc_new1 <- 1/asc
asc_new2 <- asc * 100
})
output$Plot <- renderPlot({
inFile <- input$test
if (is.null(inFile)
return (plot(data()$asc_new1)) #here I want to call asc_new1
plot(data()$asc_new2)) #here I want to call asc_new2
})
})
残念ながら、内でasc_new1
andを呼び出す方法がわかりませんでした。これは機能しません:asc_new2
data()
data()$asc_new1