Skip to content

CJ can handle list() input if sorted=FALSE but fails confusingly #3597

@MichaelChirico

Description

@MichaelChirico
CJ(1:2, list(1:3, 1))

Error in forderv(y, retGrp = TRUE) :
Column 2 is length 1 which differs from length of column 1 (3)

CJ_old(1:2, list(1:3, 1), sorted = FALSE)
   V1    V2
1:  1 1,2,3
2:  1     1
3:  2 1,2,3
4:  2     1

The logic for building the CJ output from list input is the same, but sorted has to be FALSE because there's no ordering of lists.

We can either stop here or force sorted = FALSE... either way the current behavior is confusing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions