FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Count by list columns · Issue #1597 · Rdatatable/data.table · GitHub

Count by list columns #1597

Description

Perhaps this is intentional, but it seems to me a more natural solution to this question on SO would be:

shoppinglists[ , if (.N>=3) 
  .(triplet = combn(items, 3, simplify=FALSE)), 
  by=consumer][ , .N, by=triplet][order(-N)]

But if we try and use the list column in by we get an error:

Error in`` [.data.table(shoppinglists[, if (.N >= 3) list(triplet = combn(items,`:
The items in the`by`or`keyby`list are length`(3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3)`. Each must be same length as rows in`x`or number of rows returned by`i` (18).

As cryptic as this error is, I think by is having trouble identifying unique lists (perhaps this is by design).

Is there no way to do use a list column in by?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL