Skip to content

bind_cols() gives cryptic error message for unnamed inputs #3402

@jennybc

Description

@jennybc
dplyr::bind_cols(list(1, 2))
#> Error in cbind_all(x): Not compatible with STRSXP: [type=NULL].
dplyr::bind_cols(list(one = 1, two = 2))
#> # A tibble: 1 x 2
#>     one   two
#>   <dbl> <dbl>
#> 1    1.    2.

Created on 2018-03-09 by the reprex package (v0.2.0).

Possibly relevant context: I came across this via purrr::map_dfc(). So the fact you need names and how/where to inject them is less obvious than the above reprex indicates. Hence a better error message would really pay off.

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions