Q:

Assigning a function while subsetting a data.table

Is there a specific reason why one cannot perform the following action?
v <- data.table( A = 1:2, B = vector("list", 2) )
#    A B
# 1: 1  
# 2: 2  

v[ A == 1, B := list( identity ) ]
# RHS of assignment is not NULL, not an an atomic vector (see ?is.atomic) and not a list column.

Note that B is a list column. On the other hand the following is possible (though giving a warning):
v[ A == 1, B := list(2) ]

A:

We can wrap the function in a list as it is a function
v[A == 1,  B := list(list(identity))]
v
#   A          B
#1: 1 <function>
#2: 2           

