1

入力ファイルを光沢のある状態で取得し、後でそれを使用して計算しようとしています.reactiveを使用して入力ファイルをデータフレームに割り当てようとしていますが、常に同じエラー「.getReactiveEnvironment()$currentContextのエラー:アクティブなリアクティブ コンテキストがない場合、操作は許可されません (リアクティブ式またはオブザーバー内からのみ実行できることを実行しようとしました。) スタック トレース (最も内側から):"

サーバー.R

library(shiny)
library(radarchart)
library(fmsb)
library(corrplot)

options(shiny.maxRequestSize = 9*1024^2)

function(input, output) {

  output$contents <- renderTable({
    # input$file1 will be NULL initially. After the user selects
    # and uploads a file, it will be a data frame with 'name',
    # 'size', 'type', and 'datapath' columns. The 'datapath'
    # column will contain the local filenames where the data can
    # be found.

    inFile <- input$file1

    if (is.null(inFile))
      return(NULL)

    read.csv(inFile$datapath, header = input$header,
             sep = input$sep, quote = input$quote)

    })

  candidate <-  input$file1

ui.R

   # Define UI for random distribution application 
shinyUI(pageWithSidebar(
  headerPanel('Competency Profiling Tool for Software Engineers'),
  sidebarPanel(

    fileInput('file1', 'Choose file to upload',
              accept = c(
                'text/csv',
                'text/comma-separated-values',
                '.csv')
    ),
    tags$hr(),
    checkboxInput('header', 'Header', TRUE),
    tags$hr() ,

    selectInput("dataset", "Choose level of Competence Analysis :", choices = c("Level 2", "Level 3"), selected = "Level 2"),

    radioButtons("selectedCategory","Choose Competency category : ", rownames(x), selected = "Professional skills" ),

    checkboxGroupInput('selectedLevels', 'Choose Job profile', names(scores[]), selected="Technical Junior"),

    sliderInput("Candidate", "Choose candidate :", min = 1, max = 50, value = 1),

    radioButtons( "method", "Choose Clustering method : ", choices = list("ward.D"=1,"ward.D2"=2,"Single"=3,"Complete"= 4,"Average"=5,
                                                                                 "mcquitty"=6,"median"=7,"centroid"=8),
                  selected = 4)  ),

    mainPanel(  div(tabsetPanel(type="tabs",
                          tabPanel("Level2/Level3 RCD frame", tableOutput("table")),
                          tabPanel("Candidates ACD frame", tableOutput("contents")),
                          tabPanel("Radar Plot of RCD frame" ,plotOutput("triangle", width = "80%", height = "700px"), width = 12 ),
                          tabPanel("SimpleGap & AbsoluteGap of Selected Candidate", br(),
                                     style="color:black",h1("Simple Gap  SOQ-Space  SUQ-Space  Absolute Gap"),
                                     column(width=1,offset=0,tableOutput("sgap")),
                                     column(width=1,offset=1,tableOutput("soq")),
                                     column(width=1,offset=1,tableOutput("suq")),
                                     column(width=1,offset=1,tableOutput("absgap")) ),


                          tabPanel("RCD + ACD Plots",chartJSRadarOutput("radar",width = "900%", height = "300%" ) ,
                                                     chartJSRadarOutput("radar2",width = "900%", height = "300%" ) ) ,
                          tabPanel("Clustering Plot #1",plotOutput("cluster", width = "100%", height = "900px"), width = 7 ),
                          tabPanel("Clustering Plot #2",plotOutput("cluster2",width = "100%", height = "900px"),width = 7),
                          tabPanel("Correlation Plots",plotOutput("corellation",width = "100%", height = "900px"),width = 7 )),
                  class = "span8")

  )


       )

)
4

0 に答える 0