いくつかのパラメーター (実験の数、クロス検証のフォールド数、および入力データ ファイル) を受け取り、いくつかの .R スクリプトをバックグラウンドで実行する Shiny アプリケーションを構築しようとしています。しかし、次のエラーが発生し続けます。
「操作は、アクティブなリアクティブ コンテキストなしでは許可されていません。(リアクティブ関数内からのみ実行できることを実行しようとしました。)」
私のui.Rのコードのスニペットは次のとおりです。
library(shiny)
experiments <- list(
"1" = 1,
"3" = 3,
"5" = 5,
"10" = 10,
"50" = 50
)
folds <- list(
"1" = 1,
"3" = 3,
"5" = 5,
"10" = 10
)
shinyUI(
pageWithSidebar(
headerPanel("Classification and Regression Models"),
sidebarPanel(
selectInput("experiments_number", "Choose Number of Experiments:",
choices = experiments)
selectInput("folds_number", "Choose Number of Folds:", choices = folds),
fileInput(
"file1",
"Choose a CSV file:",
accept = c('text/csv', 'text/comma-separated-values', 'text/plain')
)
),
そしてserver.Rの私のコードの始まり:
shinyServer(function(input,output){
# Server logic goes here.
experimentsInput <- reactive({
switch(input$experiments_number,
"1" = 1,
"3" = 3,
"5" = 5,
"10" = 10,
"50" = 50)
})
foldsInput <- reactive({
switch(input$folds_input,
"1" = 1,
"3" = 3,
"5" = 5,
"10" = 10)
})
if (is.null(input$file1$datapath))
return(NULL)
source("CART.R")
何か案は?
ありがとう!