read.myacc.csv() reads sf value from the header and only uses sf = rmc.sf if there was no valid value provided in the header. This sf value is returned by read.myacc.csv(), to be used elsewhere in GGIR. But the rest of read.myacc.csv() itself was using rmc.sf throughout the module, whether or not sf was indeed equal to rmc.sf. After this PR, sf will be used throughout read.myacc.csv()
There are two more places in the code where we are dividing 1/sf, so we now make sure that sf != 0 before we attempt division.
Only check for time gaps if the timestamp column is supplied.
For time gap imputation, we estimate sf if no value is provided. This estimated value isn't returned by read.myacc.csv and isn't used anywhere else. So we probably shouldn't use it for resampling either, because otherwise the resampling process is inconsistent and depends on whether or not we did time gap imputation.
Additional suggestions for #1073.
read.myacc.csv() reads
sf
value from the header and only usessf = rmc.sf
if there was no valid value provided in the header. Thissf
value is returned by read.myacc.csv(), to be used elsewhere in GGIR. But the rest of read.myacc.csv() itself was usingrmc.sf
throughout the module, whether or notsf
was indeed equal tormc.sf
. After this PR,sf
will be used throughout read.myacc.csv()There are two more places in the code where we are dividing
1/sf
, so we now make sure thatsf != 0
before we attempt division.Only check for time gaps if the timestamp column is supplied.
For time gap imputation, we estimate
sf
if no value is provided. This estimated value isn't returned by read.myacc.csv and isn't used anywhere else. So we probably shouldn't use it for resampling either, because otherwise the resampling process is inconsistent and depends on whether or not we did time gap imputation.