refactor(r): add docs + reorganize exported functions#157
Merged
Neclow merged 2 commits intosbhattlab:mainfrom Oct 22, 2025
Merged
refactor(r): add docs + reorganize exported functions#157Neclow merged 2 commits intosbhattlab:mainfrom
Neclow merged 2 commits intosbhattlab:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the R interface for the phylo2vec package by standardizing terminology from "Phylo2Vec" to "phylo2vec" (lowercase) and reorganizing the exported functions to simplify the API. The key changes include:
- Enhanced Roxygen documentation with detailed parameter descriptions, return values, and examples
- Consolidated the Newick conversion interface by introducing a unified
to_newick()function while un-exporting the lower-levelto_newick_from_vector()andto_newick_from_matrix() - Cleaned up NAMESPACE by removing exports for lower-level functions (e.g.,
cophenetic_from_matrix,incidence_coo,pre_precision_from_matrix,to_matrix,vcov_from_matrix)
Reviewed Changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| r-phylo2vec/src/rust/src/lib.rs | Updated documentation comments to use lowercase "phylo2vec" and enhanced parameter/return descriptions; un-exported several internal functions |
| r-phylo2vec/R/extendr-wrappers.R | Improved Roxygen documentation for exported functions and removed export tags from lower-level functions |
| r-phylo2vec/R/base_newick.R | Updated documentation to use lowercase "phylo2vec" terminology |
| r-phylo2vec/R/stats.R | Enhanced documentation with output shape information and lowercase "phylo2vec" terminology |
| r-phylo2vec/R/utils.R | Updated documentation to use lowercase "phylo2vec" terminology |
| r-phylo2vec/R/io.R | Added documentation for check_path() and exported save_p2v() |
| r-phylo2vec/tests/testthat/*.R | Updated test calls from to_newick_from_vector/matrix() to unified to_newick() |
| r-phylo2vec/man/*.Rd | Removed documentation files for un-exported functions and updated existing files with improved descriptions |
| r-phylo2vec/NAMESPACE | Removed exports for lower-level functions to streamline the public API |
| r-phylo2vec/README.md | Updated example to use unified to_newick() function |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(I finally got a better understanding of how rextendr plays with royxgen...)
This PR focuses on improving the consistency, clarity, and usability of the R interface and documentation for the
phylo2vecpackage.Documentation
add_leaf,check_m,check_v, and others. This improves consistency and readability for users.add_leaf,check_m,check_v,save_p2vand the newly documentedcheck_path.to_newickfunction instead of the now-unexportedto_newick_from_vectorandto_newick_from_matrix, simplifying the interface for converting phylo2vec objects to Newick format.Export and NAMESPACE Clean-up:
cophenetic_from_matrix,incidence_coo,pre_precision_from_matrix,to_matrix,vcov_from_matrix, etc.) from the NAMESPACE to reduce clutter and focus the API on primary user-facing functions.