Fixing a multiple warning “unknown column”

前端 未结 8 2035
你的背包
你的背包 2020-12-12 12:12

I have a persistent multiple warning of \"unknown column\" for all types of commands (e.g., str(x) to installing updates on packages), and not sure how to debug this or fix

8条回答
  •  执笔经年
    2020-12-12 12:47

    I ran into this problem too except through a tibble created using a dyplyr block. Here's slight modification of sabre's code to show how I came to the same error.

    library(dplyr)
    
    df <- data.frame(id = c(1,1:3), name = c("mary", "jo", "jill","steve"))
    
    t <- df %>%
      group_by(id) %>%
      summarize (n = n())
    
    t
    str(t)
    
    
    t$newvar[t$id==1] <- 0
    

提交回复
热议问题