This use of bind_cols
gives an unhelpful error message, as argument 2 below does have names.
suppressPackageStartupMessages(library(dplyr))
tibble <- tibble(x = 3:4, y = 5:6)
abc <- letters[1:3]
(abc <- t(setNames(abc, abc)))
#> a b c
#> [1,] "a" "b" "c"
tibble %>%
bind_cols(abc)
#> Error: Argument 2 must have names
Note that this works with cbind
, which is why I tried it with bind_cols
.
tibble %>%
cbind(., abc)
#> x y a b c
#> 1 3 5 a b c
#> 2 4 6 a b c
But the help is clear that bind_cols
requires data frame arguments, which is what the error message should say.
Created on 2020-02-04 by the reprex package (v0.3.0)