I've got a data.table named temp:
PID PID_Gen
a NA
c c1
b NA
d d1
The following evaluates if PID_Gen is NULL and in that case assigns the value of PID.
temp$result <- future_sapply(temp$PID_Gen,
FUN = function(x) if(is.na(x)) {temp$PID})
The problem is that it overflows the memory.
Are there any alternatives I can use?