找不到对象“数据”。它在哪里?

时间:2018-11-28 06:33:25

标签: r dplyr tidyr

Gordon <- read_csv("GordonPivot.csv")
Malabar <- read_csv("MalabarPivot.csv")
Bronte <- read_csv("BrontePivot.csv")
Lurline <- read_csv("LurlinePivot.csv")

ALL <- Malabar %>% 
full_join(Gordon, by="Count") %>%
full_join(Lurline, by="Count") %>% 
full_join(Bronte, by="Count") %>%  
select(Count, Code, Value)

Error in .f(.x[[i]], ...) : object 'Code' not found

我可以使用联接来处理我指定的“计数”,“代码”,“值”的变量。但是随着我不断收到上面的错误,我似乎无法使变量出现在完全联接中。我曾尝试纠正拼写,重新安装软件包,但没有任何工作。我会错过一些琐碎的东西吗?任何帮助表示赞赏!

1 个答案:

答案 0 :(得分:1)

在尝试使用不同的列进行联接时,您需要在列表中指定所有这三列。通过使用

c("Count", "Code", "Value")

list("Count", "Code", "Value")

这就是应该的样子,

ALL <- Malabar %>% 
full_join(Gordon, by= c("Count", "Code", "Value")) %>%
full_join(Lurline, by=c("Count", "Code", "Value")) %>% 
full_join(Bronte, by=c("Count", "Code", "Value")) %>%  
select(Count, Code, Value)