in the next snippet, data.table does not seem to recognize logic when used in i.
All my attempts to reproduce the problem in the minimal example failed, so I am posting the full section here. I expect this to be related to the "as.logical (cumsum (CURRENT_TRIP)" part, but just the gut feeling ...
# Testdata timetable <- data.table(rbind( c("r1", "t1_1", "p1", 10, 10), c("r1", "t1_1", "p2", 11, 11), c("r1", "t1_1", "p3", 12, 12), c("r1", "t1_1", "p4", 13, 13), c("r1", "t1_1", "p5", 14, 14), c("r1", "t1_1", "p6", 15, 15), c("r1", "t1_1", "p7", 16, 16), c("r1", "t1_1", "p8", 17, 17), c("r1", "t1_1", "p9", 18, 18), c("r1", "t1_1", "p10", 19, 19), c("r2", "t2", "p11", 9, 9), c("r2", "t2", "p12", 10, 10), c("r2", "t2", "p3", 11, 11), c("r2", "t2", "p13", 12, 12), c("r2", "t2", "p14", 13, 13), c("r2", "t2", "p15", 14, 14), c("r2", "t2", "p16", 15, 15), c("r2", "t2", "p17", 16, 16), c("r2", "t2", "p18", 17, 17) )) setnames(timetable, c("ROUTE", "TRIP", "STOP", "ARRIVAL", "DEPARTURE")) timetable[, ':='(ARRIVAL = as.integer(ARRIVAL), DEPARTURE = as.integer(DEPARTURE))]
any ideas?
The problem is detected using the latest versions 1.9.7 and 1.9.6 and R 3.2.3 on Win 64bit
Fab