Skip to content

Cryptic error message in case of misused xxx_join(..., by=c(...)) #1192

@petermeissner

Description

@petermeissner

This is no bug report rather a request to give more informative error messages.

If the following misuse of the join functions is undertaken the error messages are somewhat cryptic:

     data2 <- data_frame(a=1:3)
     data1 <- data_frame(a=1:3, c=3:5)

     left_join(data1, data2, by=c("a","a"))

     ## Error in left_join_impl(x, y, by$x, by$y) : attempt to set index 0/0 in SET_STRING_ELT

While the input should have been ...

     left_join(data1, data2, by=c("a"="a"))    

    ## Source: local data frame [3 x 2]
    ## 
    ##   a c
    ## 1 1 3
    ## 2 2 4
    ## 3 3 5

... a syntax error that is easy to do and hard to find.

Metadata

Metadata

Labels

bugan unexpected problem or unintended behavior

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions