« first day (574 days earlier)      last day (2601 days later) » 

11:36 AM
Am I being dense, or is this question unclear? stackoverflow.com/questions/10595737/…
 
12:06 PM
hi people
I bench mark three possible solutions
the best option seems to be to use read.table to fill in NA's where the number of columns is not the same
afterwards I want to find the rows where this happens
I use: na_rows <- apply(result_fill, 1, function(r) any(is.na(r)))
this is quite slow, any suggestions for improvement?
see the SO post for a reproducible example
 
 
2 hours later…
2:12 PM
@PaulHiemstra - any reason why using fill = TRUE in read.table() and then using complete.cases() wouldn't work? You can eek out some additional performance by specifying the column classes, and some other tips that have been outlined here on SO before.
 
3:07 PM
@PaulHiemstra Would it be good enough to just test the last column, rather than any column? I imagine part of the slowdown is the conversion to a matrix, and any upcasting that might require.
 
 
1 hour later…
4:21 PM
@BrianDiggs, manually casting to a matrix did not take a lot of time and did not speed up the apply call
but only checking the last row would ofcourse save a lot of time
@chase, the bottleneck for the fill = TRUE case is not reading from the file
but getting rid of the NA's
but ofcourse this could be different in the OP's case
but he or she does not provide a lot of information to go on
 
True
 

« first day (574 days earlier)      last day (2601 days later) »