79273752

Date: 2024-12-12 03:34:06
Score: 1.5
Natty:
Report link

Also in addition to @axeman 's answer. Here is the data.table method if you want to fill in your zeros:

# fill in zero values
setkeyv(time, cols = c("Strategy", t_type))
time <- time[CJ(Strategy, get(t_type), unique = TRUE)]
setnafill(time, fill = 0, cols = 'N')

Modified from suggestions here to adopt a variable as a column name and avoid line wrapping.

Reasons:
  • Has code block (-0.5):
  • User mentioned (1): @axeman
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: dragon951