gergness / srvyr

R package to add 'dplyr'-like Syntax for Summary Statistics of Survey Data
214 stars 28 forks source link

Update `as_survey_rep()` to accept SDR options in `type` argument #153

Closed bschneidr closed 1 year ago

bschneidr commented 1 year ago

Hi @gergness,

This is a small update to make sure that 'srvyr' allows the same function arguments to be used for the type argument of as_survey_rep(). In particular, when the user supplies their own replicate weights, users of survey::svrepdesign() can specify type="successive-difference" or type="ACS", and with this update users of srvyr::as_survey_rep() can, too.

These options weren't already in srvyr I think because they are fairly new additions to the 'survey' package . Functionally, type="ACS" and type="successive-difference" are the exact same thing; it's just that Thomas Lumley wanted users to be able to use "ACS" as a shorthand for "successive-difference", which refers to the successive differences replication (SDR) method .

I added a small unit test and added a NEWS.md item, but please let me know if you'd like me to add anything else on this.

codecov-commenter commented 1 year ago

Codecov Report

Merging #153 (63ae4da) into main (410ce1c) will not change coverage. The diff coverage is n/a.

:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage   82.88%   82.88%           
=======================================
  Files          22       22           
  Lines        1145     1145           
=======================================
  Hits          949      949           
  Misses        196      196           
Impacted Files Coverage Δ
R/as_survey_rep.r 97.29% <ø> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.