-
Notifications
You must be signed in to change notification settings - Fork 8
Arrange cannonical #511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Arrange cannonical #511
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
c94a8dd
reorder to match `new_epi_df()` constructor
dajmcdon 896a381
fix TZ warnings
dajmcdon 4151828
add internal method to arrange epi_df in canonical order (mostly usef…
dajmcdon 0763e99
styler
dajmcdon 6556991
fix R CMD Check "long example lines" Note
dajmcdon c3665e6
pass all local checks
dajmcdon 8fb30c9
bump version
dajmcdon ec43cef
style: styler (GHA)
dajmcdon 2bf591a
Use an actually-valid `tz` instead of `"ET"` in tests
brookslogan ac62ddb
respond to review
dajmcdon 7273781
Update tests/testthat/test-arrange-canonical.R
dajmcdon 46061fb
Update tests/testthat/test-utils.R
dajmcdon 08ac040
hard error in tests
dajmcdon 8ff000e
Merge branch 'dev' into arrange-cannonical
dajmcdon 4c830ef
Column order change for versioning snapshot
dsweber2 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test_that("canonical arrangement works", { | ||
tib <- tibble( | ||
x = 1:8, | ||
demo_grp = rep(c("b", "b", "a", "a"), times = 2), | ||
geo_value = rep(c("ga", "ca"), each = 4), | ||
time_value = rep(2:1, times = 4) | ||
) | ||
expect_error(arrange_canonical(tib)) | ||
|
||
tib <- tib %>% as_epi_df(additional_metadata = list(other_keys = "demo_grp")) | ||
expect_equal(names(tib), c("geo_value", "time_value", "x", "demo_grp")) | ||
|
||
tib_sorted <- arrange_canonical(tib) | ||
expect_equal(names(tib_sorted), c("geo_value", "time_value", "demo_grp", "x")) | ||
expect_equal(tib_sorted$geo_value, rep(c("ca", "ga"), each = 4)) | ||
expect_equal(tib_sorted$time_value, c(1, 1, 2, 2, 1, 1, 2, 2)) | ||
expect_equal(tib_sorted$demo_grp, rep(letters[1:2], times = 4)) | ||
expect_equal(tib_sorted$x, c(8, 6, 7, 5, 4, 2, 3, 1)) | ||
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.