Skip to content

Add an alias for functional version of := #3795

@eliocamp

Description

@eliocamp

Right now when adding multiple columns to a data.table one of the options is to do:

dt[, `:=`(col1 = stuff, col2 = moar_stuff)]

I think that this syntax can be a bit confusing (too many equals) but mainly is hard to write. To get the grave accent, on my keyboard I have to press AltGr + } and then space. It's kind of annoying.

So my modest proposal is to just have an alias for :=() that is just a run-off-the-mill common name with no special characters. Maybe (ab)using the set() function? It would end up something like this:

dt[, set(col1 = stuff, col2 = moar_stuff)]

I think it not only reads better, but it's also 87% easier to type.

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