BiologicalRecordsCentre / sparta

Species Presence/Absence R Trends Analyses
http://biologicalrecordscentre.github.io/sparta/index.html
MIT License
21 stars 24 forks source link

Removing duplicate observations warning incorrect when using 'replicate' #153

Closed drnickisaac closed 5 years ago

drnickisaac commented 5 years ago

Since we added the replicate option to the data structure, I think a bug has been introduced into the warning.

The warning in errorChecks lines 45-51 does not include replicate. However, the information in replicate is being used correctly when the BUGS data is being prepared, at line 152 of formatOccData.

This means that if replicate is included in the input data, the information it provides does not filter through to the warning message. So the warning message is wrong, but the formatting of the data is correct.

We could add replicate to line 45 & 47, but I don't know what would happen where replicate = NULL (the default).

AugustT commented 5 years ago

https://github.com/BiologicalRecordsCentre/sparta/blob/2dcaf412fff94ed8b6722908b6135a77a24f4d87/R/errorChecks.r#L45

AugustT commented 5 years ago

@drnickisaac can you add a reproducible example and tell me what warning message you get?

AugustT commented 5 years ago

I also see the pipes have been erroneously added back in

https://github.com/BiologicalRecordsCentre/sparta/blob/2dcaf412fff94ed8b6722908b6135a77a24f4d87/R/formatOccData.r#L134

Can you remove these?

drnickisaac commented 5 years ago

@AugustT I have fixed the errorChecks bug. The pipe error is quite a different issue and should be separated (then this issue can be closed). I'd rather not attempt to fix it as my understanding of the syntax is imperfect.