When running a data set D with the following statement, I got an error message showing "Error: k <= n is not TRUE":
D[, D60:= rollapply(close, 60, mean, align='left', fill = NA), by=.(code)]
The data set has 879576 rows and 15 columns. Is there any way to fix this problem?