BiologicalRecordsCentre / sparta

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

allow reportingRateModel to take a numeric vector of time periods. ex… #235

Closed robboyd closed 1 year ago

robboyd commented 3 years ago

…pect_error test removed to reflect that the function should no longer return an error when time_periods are not in date format

robboyd commented 3 years ago

@AugustT I have added a new test to make sure equivalent results are returned when time_periods are in date or numeric format. I had to create a new set of dates all with the same years as the numeric time_periods and all with month and day = 01. I did this so that the same number of duplicates were removed (i.e. all duplicates within a time period, not within a visit). The ability to specify time periods as a numeric vector should now enable users to fit models at coarser temporal resolutions than the visit level (which is what I need for my SURPASS stuff). Does this make sense?

codecov-commenter commented 3 years ago

Codecov Report

Merging #235 (8898a78) into master (14919c1) will increase coverage by 0.14%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #235      +/-   ##
==========================================
+ Coverage   39.11%   39.25%   +0.14%     
==========================================
  Files          86       86              
  Lines        2861     2863       +2     
==========================================
+ Hits         1119     1124       +5     
+ Misses       1742     1739       -3     
Impacted Files Coverage Δ
R/reportingRateModel.r 100.00% <100.00%> (+7.31%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 14919c1...8898a78. Read the comment docs.

AugustT commented 3 years ago

@robboyd Can you bump the version number then merge?

AugustT commented 1 year ago

I have pulled this into my fork, have bumped the version number and put in a fresh pull request