Skip to content

Should Pipe Operator Work on Set Functions? #6862

@waynelapierre

Description

@waynelapierre
library(data.table)
x <- data.table(rnorm(5))
setnames(x, new = "v1") |> summary()

This code works but feels strange. The reason is that the set functions in data.table do not return anything. In C++, pipe operator only works on functions that return something.

Any clarification would be highly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions