首页 > 解决方案 > 这个怎么解决??[<-.data.frame 中的错误:新列将在现有列之后留下孔

问题描述

下面是我的代码。这是我闪亮的应用程序的一部分。每当我尝试运行该应用程序时,都会出现
错误 [<-.data.frame: 新列会在现有列之后留下孔洞

    not_found[,4:ncol(results)] <- NA
    colnames(not_found) <- colnames(results)    
        
    results <- rbind(results, not_found)
    
    #Remove columns that are not useful
    drop <- grepl("(original|super|_v2_|wib|necta|cia|_at|population|is_micro|dma|type_id|region|zip)",
 colnames(results), ignore.case = TRUE, perl = TRUE)
   
    results <- results[, drop == FALSE]
    
    results
    
})


output$contents <- renderTable({
    req(mydata())
    mydata()
    
})

output$response <- renderTable({
    myresponse()
    
})

标签: r

解决方案


推荐阅读