Clean up (re-document, fix linters, update old magritr to native pipe)#1099
Conversation
There was a problem hiding this comment.
nice cleanup, pipe migration is thorough. one blocker though:
removing import(methods) (and the stats/utils importFroms) breaks the namespace load. R CMD check is 3 WARN 5 NOTE with could not find function "is" / "new". load_all hides it because it attaches the deps, only a real install/check shows it.
re-add @import methods + importFrom(stats, setNames, na.omit, quantile) + importFrom(utils, head, tail, head.matrix, tail.matrix) and it's good. prop.test/binom.test/relevel/tagList/%>% are actually unused now so dropping those is fine.
|
omg! This finally happens! thanks so much man! @munoztd0 |
There was a problem hiding this comment.
Pull request overview
This PR modernizes the package’s examples/tests by migrating from magrittr piping to base R’s native pipe, and removes the magrittr dependency as part of a broader documentation / lint cleanup.
Changes:
- Replaced
%>%with|>across vignettes, README(s), man pages, and tests. - Removed
magrittrfrom package dependencies and pre-commit setup, and updated generated NAMESPACE accordingly. - Minor linter-style edits in a couple of R functions (e.g., avoiding explicit
return()in tail position).
Reviewed changes
Copilot reviewed 118 out of 121 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| vignettes/title_footer.Rmd | Switch vignette examples from %>% to ` |
| vignettes/tabulation_dplyr.Rmd | Switch vignette examples from %>% to ` |
| vignettes/tabulation_concepts.Rmd | Switch vignette examples from %>% to ` |
| vignettes/subsetting_tables.Rmd | Switch vignette examples from %>% to ` |
| vignettes/split_functions.Rmd | Switch vignette examples from %>% to ` |
| vignettes/sorting_pruning.Rmd | Switch vignette examples/prose from %>% to ` |
| vignettes/rtables.Rmd | Switch vignette examples from %>% to ` |
| vignettes/introspecting_tables.Rmd | Switch vignette examples from %>% to ` |
| vignettes/guided_intermediate_translating_shells.Rmd | Switch vignette examples from %>% to ` |
| vignettes/format_precedence.Rmd | Switch vignette examples from %>% to ` |
| vignettes/example_analysis_coxreg.Rmd | Switch vignette examples from %>% to ` |
| vignettes/dev-guide/dg_tabulation.Rmd | Switch dev-guide examples from %>% to ` |
| vignettes/dev-guide/dg_table_hierarchy.Rmd | Switch dev-guide examples from %>% to ` |
| vignettes/dev-guide/dg_split_machinery.Rmd | Switch dev-guide examples from %>% to ` |
| vignettes/dev-guide/dg_printing.Rmd | Switch dev-guide examples from %>% to ` |
| vignettes/dev-guide/dg_notes.Rmd | Switch dev-guide examples from %>% to ` |
| vignettes/custom_appearance.Rmd | Switch vignette examples from %>% to ` |
| vignettes/col_counts.Rmd | Switch vignette examples from %>% to ` |
| vignettes/baseline.Rmd | Switch vignette examples from %>% to ` |
| vignettes/ard_how_to.Rmd | Switch vignette examples from %>% to ` |
| vignettes/advanced_usage.Rmd | Switch vignette examples from %>% to ` |
| tests/testthat/test-sort-prune.R | Switch tests from %>% to ` |
| tests/testthat/test-sanitize-struct.R | Switch tests from %>% to ` |
| tests/testthat/test-result_data_frame.R | Switch tests from %>% to ` |
| tests/testthat/test-pagination.R | Switch tests from %>% to ` |
| tests/testthat/test-matrix_form.R | Switch tests from %>% to ` |
| tests/testthat/test-make-afun.R | Switch tests from %>% to ` |
| tests/testthat/test-indent-mod.R | Switch tests from %>% to ` |
| tests/testthat/test-header-footer.R | Switch tests from %>% to ` |
| tests/testthat/test-formatting.R | Switch tests from %>% to ` |
| tests/testthat/test-exporters.R | Switch tests from %>% to ` |
| tests/testthat/test-deprecated.R | Switch tests from %>% to ` |
| tests/testthat/test-default_split_funs.R | Switch tests from %>% to ` |
| tests/testthat/test-colby_constructors.R | Switch tests from %>% to ` |
| tests/testthat/test-binding.R | Switch tests from %>% to ` |
| tests/testthat/test-as_html.R | Switch tests from %>% to ` |
| README.Rmd | Switch README examples from %>% to ` |
| README.md | Switch README examples from %>% to ` |
| R/Viewer.R | Update roxygen examples to use ` |
| R/validate_table_struct.R | Small lint-style change (return(FALSE) → FALSE). |
| R/utils.R | Small lint-style change (avoid explicit return() in one branch). |
| R/tt_toString.R | Update roxygen examples to use ` |
| R/tt_sort.R | Update roxygen examples to use ` |
| R/tt_showmethods.R | Update roxygen examples to use ` |
| R/tt_pos_and_access.R | Update roxygen examples to use ` |
| R/tt_paginate.R | Update roxygen examples to use ` |
| R/tt_export.R | Update roxygen examples to use ` |
| R/tt_dotabulation.R | Update roxygen examples to use ` |
| R/tt_compatibility.R | Update roxygen examples to use ` |
| R/tt_compare_tables.R | Update roxygen examples to use ` |
| R/tt_as_df.R | Update roxygen examples to use ` |
| R/tt_afun_utils.R | Update roxygen examples to use ` |
| R/tree_accessors.R | Update roxygen examples to use ` |
| R/summary.R | Update roxygen examples to use ` |
| R/package.R | Remove package-level roxygen import directives (now just \"_PACKAGE\"). |
| R/make_split_fun.R | Update roxygen examples to use ` |
| R/indent.R | Update roxygen examples to use ` |
| R/default_split_funs.R | Update roxygen examples to use ` |
| R/custom_split_funs.R | Update roxygen examples to use ` |
| NAMESPACE | Remove magrittr/stats/utils importFrom lines and other import cleanup. |
| man/vil.Rd | Switch Rd examples from \\%>\\% to ` |
| man/Viewer.Rd | Switch Rd examples from \\%>\\% to ` |
| man/varcuts.Rd | Switch Rd examples from \\%>\\% to ` |
| man/value_formats.Rd | Switch Rd examples from \\%>\\% to ` |
| man/ttap.Rd | Switch Rd examples from \\%>\\% to ` |
| man/trim_rows.Rd | Switch Rd examples from \\%>\\% to ` |
| man/trim_prune_funs.Rd | Switch Rd examples from \\%>\\% to ` |
| man/trim_levels_to_map.Rd | Switch Rd examples from \\%>\\% to ` |
| man/tostring.Rd | Switch Rd examples from \\%>\\% to ` |
| man/table_structure.Rd | Switch Rd examples from \\%>\\% to ` |
| man/table_shell.Rd | Switch Rd examples from \\%>\\% to ` |
| man/summarize_row_groups.Rd | Switch Rd examples from \\%>\\% to ` |
| man/subset_cols.Rd | Switch Rd examples from \\%>\\% to ` |
| man/split_rows_by.Rd | Switch Rd examples from \\%>\\% to ` |
| man/split_rows_by_multivar.Rd | Switch Rd examples from \\%>\\% to ` |
| man/split_funcs.Rd | Switch Rd examples from \\%>\\% to ` |
| man/split_cols_by.Rd | Switch Rd examples from \\%>\\% to ` |
| man/split_cols_by_multivar.Rd | Switch Rd examples from \\%>\\% to ` |
| man/sort_at_path.Rd | Switch Rd examples from \\%>\\% to ` |
| man/section_div.Rd | Switch Rd examples from \\%>\\% to ` |
| man/sanitize_table_struct.Rd | Switch Rd examples from \\%>\\% to ` |
| man/row_paths_summary.Rd | Switch Rd examples from \\%>\\% to ` |
| man/rm_all_colcounts.Rd | Switch Rd examples from \\%>\\% to ` |
| man/ref_fnotes.Rd | Switch Rd examples from \\%>\\% to ` |
| man/reexports.Rd | Switch Rd examples from \\%>\\% to ` |
| man/prune_table.Rd | Switch Rd examples from \\%>\\% to ` |
| man/paginate.Rd | Switch Rd examples from \\%>\\% to ` |
| man/matrix_form-VTableTree-method.Rd | Switch Rd examples from \\%>\\% to ` |
| man/make_split_fun.Rd | Switch Rd examples from \\%>\\% to ` |
| man/make_col_row_df.Rd | Switch Rd examples from \\%>\\% to ` |
| man/label_at_path.Rd | Switch Rd examples from \\%>\\% to ` |
| man/int_methods.Rd | Switch Rd examples from \\%>\\% to ` |
| man/insert_rrow.Rd | Switch Rd examples from \\%>\\% to ` |
| man/insert_row_at_path.Rd | Switch Rd examples from \\%>\\% to ` |
| man/in_rows.Rd | Switch Rd examples from \\%>\\% to ` |
| man/gfc.Rd | Switch Rd examples from \\%>\\% to ` |
| man/facet_colcount.Rd | Switch Rd examples from \\%>\\% to ` |
| man/do_base_split.Rd | Switch Rd examples from \\%>\\% to ` |
| man/dimensions.Rd | Switch Rd examples from \\%>\\% to ` |
| man/data.frame_export.Rd | Switch Rd examples from \\%>\\% to ` |
| man/custom_split_funs.Rd | Switch Rd examples from \\%>\\% to ` |
| man/coltree_structure.Rd | Switch Rd examples from \\%>\\% to ` |
| man/clear_imods.Rd | Switch Rd examples from \\%>\\% to ` |
| man/cell_values.Rd | Switch Rd examples from \\%>\\% to ` |
| man/build_table.Rd | Switch Rd examples from \\%>\\% to ` |
| man/brackets.Rd | Switch Rd examples from \\%>\\% to ` |
| man/basic_table.Rd | Switch Rd examples from \\%>\\% to ` |
| man/append_topleft.Rd | Switch Rd examples from \\%>\\% to ` |
| man/analyze.Rd | Switch Rd examples from \\%>\\% to ` |
| man/analyze_colvars.Rd | Switch Rd examples from \\%>\\% to ` |
| man/add_overall_level.Rd | Switch Rd examples from \\%>\\% to ` |
| man/add_overall_col.Rd | Switch Rd examples from \\%>\\% to ` |
| man/add_existing_table.Rd | Switch Rd examples from \\%>\\% to ` |
| man/add_combo_facet.Rd | Switch Rd examples from \\%>\\% to ` |
| man/add_colcounts.Rd | Switch Rd examples from \\%>\\% to ` |
| DESCRIPTION | Remove magrittr dependency + add contributor entry + adjust Config/Needs/verdepcheck. |
| .pre-commit-config.yaml | Remove magrittr from roxygenize hook dependencies. |
Files not reviewed (3)
- man/Viewer.Rd: Generated file
- man/add_colcounts.Rd: Generated file
- man/add_combo_facet.Rd: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Anytime! Please let me know if you need this kinda of help enywhere else in the NEST ecosytem, I am always here to help/support it. |
Signed-off-by: David Muñoz Tord <david.munoztord@mailbox.org>
Signed-off-by: David Muñoz Tord <david.munoztord@mailbox.org>
As per we discussed runned a little clean up to be able to do the next PRs with ease of mind.