Skip to content

names() and := #1824

Closed
Closed

Description

@sinanshi

Hi,
We usually assume that the name() function returns a character vector instead of the memory reference. However with the operator := it seems that the n becomes the memory reference. Do you think it is necessary not to return the reference?

a <- data.table(a=seq(10), b=seq(10))
> n<-names(a) 
[1] "a" "b" 
> a[,c:=seq(10)]
> n # we expect n is just a vector.
[1] "a" "b" "c" 

Activity

  1. jangorecki commented on Aug 24, 2016

    @jangorecki
    Member

    Hi, this is documented in ?copy, link provided by David is also good references about that behavior.

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

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