I faced the same problem, and although I do not know why this happens, I was able to fix it when this happens, and thus prevent it.
The problem seems to be related to adding a new column, derived from indexing, to the base data frame R or as a data frame. Take this example when you add a new column ( age ) to the base data frame R:
base_df <- data.frame(id = c(1:3), name = c("mary", "jill","steve")) base_df$age[base_df$name == "mary"] <- 47
This works without returning a warning. But when the same thing is done with Tibet, it gives a warning (and therefore, I think that you are causing a strange, seemingly unprovoked problem with several warnings):
library(tibble) tibble_df <- tibble(id = c(1:3), name = c("mary", "jill","steve")) tibble_df$age[tibble_df$name == "mary"] <- 47 Warning message: Unknown column 'age'
There are, of course, better ways to avoid this, but I found that first creating the NA vector does the job:
tibble_df$age <- NA tibble_df$age[tibble_df$name == "mary"] <- 47
sabre Sep 28 '16 at 21:43 2016-09-28 21:43
source share