Appending of the S object (i.e., leftover data from previous chunk) when reading the file is problematic when there are remaining epochs to be imputed in the current chunk, yet there were not remaining epochs in the previous chunk (i.e., in S).
Lines 242:249 of g.getmeta are in charge of appending the data:
if (params_rawdata[["imputeTimegaps"]]) {
if ("remaining_epochs" %in% colnames(data)) {
if (ncol(S) == (ncol(data) - 1)) {
# this block has time gaps while the previous block did not
S = cbind(S, 1)
colnames(S)[4] = "remaining_epochs"
}
}
The line colnames(S)[4] = "remaining_epochs" would change the column name z for remaining_epochs in the case that time is available in the file. Columns would be time (1), x (2), y (3), z(4)... Instead, I propose changing that line to colnames(S)[ncol(s)] = "remaining_epochs" so that it adapts to the number of columns.
Appending of the
S
object (i.e., leftover data from previous chunk) when reading the file is problematic when there are remaining epochs to be imputed in the current chunk, yet there were not remaining epochs in the previous chunk (i.e., inS
).Lines 242:249 of g.getmeta are in charge of appending the data:
The line
colnames(S)[4] = "remaining_epochs"
would change the column name z for remaining_epochs in the case that time is available in the file. Columns would be time (1), x (2), y (3), z(4)... Instead, I propose changing that line tocolnames(S)[ncol(s)] = "remaining_epochs"
so that it adapts to the number of columns.