Closed rsh52 closed 1 year ago
@skadauke skimr
manual labels from this morning applied, basically just super simplifies the make_skimr_labels()
function.
For the snapshot testing, I tried forcing the example from the expect_snapshot_file()
documentation, but couldn't get it to successfully compare the XLSX output in the snaps folder. Defaulting back to this line from the docs:
"Whole file snapshot testing is designed for testing objects that don't have a convenient textual representation, with initial support for images (.png, .jpg, .svg), data frames (.csv), and text files (.R, .txt, .json, ...)"
Instead, went through all of the wb
objects and moved the ones of interest to a list()
for a single snapshot test.
Aaaah yes. Codecov 🙂
How about a test that checks that the function returns a named list?
S
From: Rich Hanna @.> Sent: Wednesday, May 24, 2023 9:10 AM To: CHOP-CGTInformatics/REDCapTidieR @.> Cc: Stephan Kadauke @.>; Mention @.> Subject: [External]Re: [CHOP-CGTInformatics/REDCapTidieR] skimr and write XLSX Enhancements (PR #151)
@rsh52 commented on this pull request.
In tests/testthat/test-utils.Rhttps://github.com/CHOP-CGTInformatics/REDCapTidieR/pull/151#discussion_r1204106390:
- df <- tibble::tribble(
- ~"one", ~"two", ~"three",
- 1, 2, 3
- )
- is_labelled <- is_labelled(df)
- expect_false(is_labelled)
- labels <- c("One", "Two", "Three")
- labelled::var_label(df) <- labels
- is_labelled <- is_labelled(df)
- expect_true(is_labelled) +})
+test_that("make_skimr_labels works", {
Yea, let's get rid of it. I was thinking more of how I didn't want to see our codecov badge take a hit haha.
— Reply to this email directly, view it on GitHubhttps://github.com/CHOP-CGTInformatics/REDCapTidieR/pull/151#discussion_r1204106390, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACTGHWXRCE6WVPVQZ3BULMLXHYCDTANCNFSM6AAAAAAYK2FXJQ. You are receiving this because you were mentioned.Message ID: @.***>
This email originated from an EXTERNAL sender to CHOP. Proceed with caution when replying, opening attachments, or clicking links. Do not disclose your CHOP credentials, employee information, or protected health information to a potential hacker.
❤️
From: Rich Hanna @.> Sent: Wednesday, May 24, 2023 9:17 AM To: CHOP-CGTInformatics/REDCapTidieR @.> Cc: Stephan Kadauke @.>; Mention @.> Subject: [External]Re: [CHOP-CGTInformatics/REDCapTidieR] skimr and write XLSX Enhancements (PR #151)
@rsh52 commented on this pull request.
In tests/testthat/test-utils.Rhttps://github.com/CHOP-CGTInformatics/REDCapTidieR/pull/151#discussion_r1204120437:
- df <- tibble::tribble(
- ~"one", ~"two", ~"three",
- 1, 2, 3
- )
- is_labelled <- is_labelled(df)
- expect_false(is_labelled)
- labels <- c("One", "Two", "Three")
- labelled::var_label(df) <- labels
- is_labelled <- is_labelled(df)
- expect_true(is_labelled) +})
+test_that("make_skimr_labels works", {
Aaaah yes. Codecov 🙂 How about a test that checks that the function returns a named list?
Sure sounds good to me! Gotta keep the number high and shiny
— Reply to this email directly, view it on GitHubhttps://github.com/CHOP-CGTInformatics/REDCapTidieR/pull/151#discussion_r1204120437, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACTGHWRNPUJ67J65KWSONWLXHYDABANCNFSM6AAAAAAYK2FXJQ. You are receiving this because you were mentioned.Message ID: @.***>
This email originated from an EXTERNAL sender to CHOP. Proceed with caution when replying, opening attachments, or clicking links. Do not disclose your CHOP credentials, employee information, or protected health information to a potential hacker.
@skadauke changes implemented, emailed over a copy of the labelled skimr XLSX output. 🤞
Approval secured via e-mail 🚀
Description
This PR seeks to expand on and improve the
add_skimr_metadata()
andwrite_redcap_xlsx()
functions, reorganize some of the code base, and add new tests to thetestthat
suite.Two of the biggest changes involve adding labels to the default skimmers and their output in the Excel sheet and ensuring labels get applied regardless of whether a user executes
make_labelled()
oradd_skimr_metadata()
first.Proposed Changes
List changes below in bullet format:
add_skimr_metadata()
andmake_labelled()
make_skimr_labs()
utils.R
, write internal documentation, add tests:is_labelled()
make_skimr_labs()
safe_set_variable_labels()
redcap_form_label
inwrite_redcap_xlsx()
"REDCap Metadata" Sheet outputmake_labelled()
/add_skimr_metadata()
/write_redcap_xlsx()
Not addressed in this PR
Additional documentation improvements and updates to the README, vignettes, etc. To be included in a subsequent PR once merged.
Issue Addressed
Closes #150
PR Checklist
Before submitting this PR, please check and verify below that the submission meets the below criteria:
.RDS
) updated underinst/testdata/create_test_data.R
httptest::with_mock_api
and any new mocks were added totests/testthat/fixtures/create_httptest_mocks.R
usethis::use_dev_version()
Code Review
This section to be used by the reviewer and developers during Code Review after PR submission
Code Review Checklist