Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Jun 26, 2024
1 parent 578eb18 commit c3648e3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 17 deletions.
2 changes: 1 addition & 1 deletion R/ard_continuous.survey.design.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ ard_continuous.survey.design <- function(data, variables, by = NULL,
unlist())
) |>
tidyr::unnest(cols = c("stat_name", "stat_label")),
by = "stat_name",
by = c("variable", "stat_name"),
unmatched = "ignore"
)
}
Expand Down
4 changes: 2 additions & 2 deletions man/ard_dichotomous.survey.design.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions tests/testthat/_snaps/ard_continuous.survey.design.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@
# ard_continuous.survey.design(stat_label)

Code
ard_continuous(dclus1, variables = api00, statistic = ~ c("mean", "median",
"min", "max"), stat_label = list(api00 = list(mean = "MeAn", median = "MEDian",
min = "MINimum")))
Message
{cards} data frame: 4 x 8
as.data.frame(ard_continuous(dclus1, variables = c(api00, api99), statistic = ~
c("mean", "median", "min", "max"), stat_label = list(api00 = list(mean = "MeAn",
median = "MEDian", min = "MINimum"))))
Output
variable context stat_name stat_label stat fmt_fn
1 api00 continuo… mean MeAn 644.169 1
2 api00 continuo… median MEDian 652 1
3 api00 continuo… min MINimum 411 1
4 api00 continuo… max Maximum 905 1
Message
i 2 more variables: warning, error
variable context stat_name stat_label stat fmt_fn warning error
1 api00 continuous mean MeAn 644.1694 1 NULL NULL
2 api00 continuous median MEDian 652 1 NULL NULL
3 api00 continuous min MINimum 411 1 NULL NULL
4 api00 continuous max Maximum 905 1 NULL NULL
5 api99 continuous mean Mean 606.9781 1 NULL NULL
6 api99 continuous median Median 615 1 NULL NULL
7 api99 continuous min Minimum 365 1 NULL NULL
8 api99 continuous max Maximum 890 1 NULL NULL

5 changes: 3 additions & 2 deletions tests/testthat/test-ard_continuous.survey.design.R
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ test_that("ard_continuous.survey.design(stat_label)", {
expect_snapshot(
ard_continuous(
dclus1,
variables = api00,
variables = c(api00, api99),
statistic = ~ c("mean", "median", "min", "max"),
stat_label = list(api00 = list(mean = "MeAn", median = "MEDian", min = "MINimum"))
)
) |>
as.data.frame()
)
})

Expand Down

0 comments on commit c3648e3

Please sign in to comment.