This PR seeks to add factor levels and their associated order to the event names and their associated labels when available in the redcap_events column of the supertibble. It does not change how redcap_event appears in the data tibbles of the supertibble, which I think is fine since it should represent the REDCapR output. Users can easily get the level order from the redcap_events column of the supertibble with this branch's setup and it will serve my use case for REDCapExploreR.
Proposed Changes
List changes below in bullet format:
Add forcats to DESCRIPTION to make use of fct_inorder()
Update link_arms() to establish and assign factor levels and orders
Update add_event_mapping() to use link_arms() output and assign factor levels and order
Update associated tests
Issue Addressed
Closes #210
PR Checklist
Before submitting this PR, please check and verify below that the submission meets the below criteria:
[ ] New/revised functions have associated tests
[ ] New/revised functions that update downstream outputs have associated static testing files (.RDS) updated under inst/testdata/create_test_data.R
[x] New/revised functions use appropriate naming conventions
Description
This PR seeks to add factor levels and their associated order to the event names and their associated labels when available in the
redcap_events
column of the supertibble. It does not change howredcap_event
appears in the data tibbles of the supertibble, which I think is fine since it should represent the REDCapR output. Users can easily get the level order from theredcap_events
column of the supertibble with this branch's setup and it will serve my use case for REDCapExploreR.Proposed Changes
List changes below in bullet format:
forcats
toDESCRIPTION
to make use offct_inorder()
link_arms()
to establish and assign factor levels and ordersadd_event_mapping()
to uselink_arms()
output and assign factor levels and orderIssue Addressed
Closes #210
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
usethis::use_version()
Code Review
This section to be used by the reviewer and developers during Code Review after PR submission
Code Review Checklist