ctmm-initiative / ctmm

Continuous-Time Movement Modeling. Functions for identifying, fitting, and applying continuous-space, continuous-time stochastic movement models to animal tracking data.
http://biology.umd.edu/movement.html
43 stars 10 forks source link

data.table new version throw warning instead of error when reading zip #19

Closed xhdong-umd closed 6 years ago

xhdong-umd commented 6 years ago

I found the newer version of data.table changed behavior when using fread on a zip.

Previously it will throw error, now it will generate warning but still return an empty data.frame. Thus the error condition check need to be updated to reflect the change. The change should also work with previous version of data.table.

chfleming commented 6 years ago

@xhdong-umd Is there any way to avoid these new fread warning messages if they are not necessary?

Warning in data.table::fread(object, data.table = FALSE, check.names =

TRUE, : Stopped early on line 2. Expected 1 fields but found 1. Consider

fill=TRUE and comment.char=. First discarded non-empty line: <<>>

xhdong-umd commented 6 years ago

We can suppress the warnings. I didn't do it in the beginning because sometimes there could be some warning messages relate to column formats.

For example data.table try to guess the column data type from a sample of rows, if there is some special row conflict with the guessed data type, there will be warnings.

I think this can be helpful sometimes, but I agree this warning caused by zip is confusing when the behavior is running as expected. However I can't think of a simple way to separate the confusing warning (caused by zip in our case) from the other possible helpful warning, we can only turn all of them off.

xhdong-umd commented 6 years ago

I made a commit to suppress warning here if you think it's OK to turn them all off.