如何根据闪亮的用户输入上传文件后如何创建列

时间:2019-06-26 07:24:25

标签: r shiny

我有一个闪亮的代码,用户正在其中输入两个列。通过selectizeinput的FPID和RPID。我想创建一个新的列用户,这将是对这两个列(FPID和RPID)所做的一些操作的结果

   Data_new <- reactive({
   req(input$FPID)
   req(input$RPID)

   target_FP <- data()[input$FPID][!(data()[input$RPID]=="" |data() 
  [input$RPID]=='NA'|data()[input$RPID] =='\\N'| is.na(data() 
 [input$RPID]))] 
    as.data.frame(target_FP)
   return(Data_new)
 })

 ## render table of Data_new() -------------------
  output$ProcessedOut <- renderTable({
   req(input$FPID)
   Data_new()
  })

#--------------- Users Impute
    #selecting the target FPs separately
   #target_FP <- df$FPID[!(df$RPID ==""|df$RPID =='NA'|df$RPID 
=='\\N'|is.na(df$RPID))]
   #target_FP <- data()[input$FPID][!(data()[input$RPID]==""|data() 
  [input$RPID=="\\N"]|is.na(data()[input$RPID]))]
   #target_FP
   #target_FP <- data.frame(target_FP)
    #target_FP <- distinct(target_FP)

  #assigning the value
  #df$RPID <- as.character(df$RPID)
   #df$RPID[(df$FPID%in%target_FP$target_FP)&(df$RPID ==""|df$RPID 
    =='NA'|df$RPID =='\\N'|is.na(df$RPID))] <- "Known"
     #df$RPID <- as.factor(df$RPID) 

     #DONE
      #df$Users <- df$RPID
       #df$Users <- as.character(df$Users)
        #df$Users[is.na(df$Users)] <- 'Unknown'
      #df$Users[(df$Users != 'Unknown')&(df$Users != 'Known')] <- 'Known'
      #df$Users <- as.factor(df$Users)
     #---------------

我要以闪亮的方式执行此操作,其中FPID和RPID是用户输入

0 个答案:

没有答案