Skip to content

[R-Forge #5442] Possible wrong assignment to list columns #35

@arunsrinivasan

Description

@arunsrinivasan

Submitted by: Michele Carriero; Assigned to: Arun ; R-Forge link

Hello, please consider the following two assignments to an element of a list column, which I think should not give the same result:

library(data.table)
dt <- data.table(id=1:2, comment=vector(mode="list", length=2))

dt[1L, comment := 1]
a<-dt$comment
dt[1L, comment := list(list(1))]
b<-dt$comment  

> identical(a, b)
# [1] TRUE

This possible bug came up after a Arun's answer on SO:

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions