反応式内の特定の変数を呼び出したいと思います。このような何か:R Shiny Appの反応性データ()からの呼び出し変数
server.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
})
})
は、残念ながら、私はdata()
内asc_new1
とasc_new2
を呼び出す方法を見つけるcould't。この1は動作しません:
data()$asc_new1
何らかの理由で、私はまだ同じエラーが発生します。私は私の変数を 'list'に入れましたが、私はまだそれを呼び出すことができません:' Data内のエラー$ fitnew:$ operatorはこのS4クラスに対して定義されていません ' –
あなたは間違いなく' list'を最後あなたの 'data()'関数の行?これが返されます。 – MadScone
これは今動作します!どうもありがとう! –