I have a data.table with the following (tidy-data format) columns
Time-C1-C2-C3-C4
If it is groupped according to Time
column, the column C1 currently contains some of integer value between 1-50, I want to extend that column so that if contains all the integer from 1 to 50 for each given Time
value. I want to do this extension by filling the other columns of these new data point with NA
. In other words, say the value 1
is missing from the C1 for Time=1s
, then I'll add the following row to the dataset
Time-C1-C2-C3-C4
1 1 NA NA NA
How can I do this?