Sorry for a very basic question, solution must be very simple but I\'m not able to find it.
Trying to use gsub adding a new column in a data.table, I got the warning
dt[, v3 := gsub("x", v1, v2), by = v1]