Conversation
* Document and export format_number_h * ...
|
@copilot Could you please resolve the conflicts Intelligently ? |
|
@vertesy I can’t apply these changes because the pull request’s branch is the repository’s default branch, which I’m not allowed to push to directly. You can ask me to create a new pull request with the requested changes instead and I'll open a separate PR on a new branch. |
There was a problem hiding this comment.
Pull request overview
This PR is a "Update Dev" release for the Stringendo R string-manipulation package. It bumps the version to 1.1.1, refactors and renames a number of paste/collapse helpers (pnl→ppnl, knl→kpnl, new ppc), extends parsepvalue, ReplaceSpecialCharacters, and format_number_h, deprecates ifExistsElse/parFlags/flag.names_list.all.new, and updates tests, NAMESPACE, README and man pages accordingly. An older development bootstrap script is removed.
Changes:
- Rename/deprecate several functions and add new helpers (
ppc,ppnl,kpnl,format_number_h), with corresponding NAMESPACE and.Rdupdates. - Extend behavior of
parsepvalue,ReplaceSpecialCharacters,flag.names_list, plus stylistic clean-ups (F→FALSE,&→&&, brace formatting). - Add tests for
format_number_hand tightenpercentage_formattertests; bump package version to 1.1.1, refresh README function list, drop legacy development script.
Reviewed changes
Copilot reviewed 13 out of 26 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| R/Stringendo.R | Core refactor: renames, new functions, behavior changes in parsepvalue, ReplaceSpecialCharacters, flag.names_list, deprecations. |
| NAMESPACE | Adds/removes exports to match renames (ppc, ppnl, kpnl, format_number_h; removes pnl, knl, flag.names_list.all.new). |
| tests/testthat/test-format_number_h.R | New tests for format_number_h. |
| tests/testthat/test-percentage_formatter.R | Update expectations to NA_character_ and "NaN". |
| README.md | Refresh install command and auto-generated function list. |
| DESCRIPTION / CITATION.cff / Development/config.R | Version bump to 1.1.1, title/metadata refresh. |
| man/*.Rd | Regenerated/added Rd files for renames and new/changed signatures. |
| Development/Create_the_Stringendo_Package.R | Minor tweaks; adds extra blank lines and absolute paths. |
| Development/Create_the_Stringendo_Package.OLD.R | Removed legacy bootstrap script. |
| .gitignore | Add .DS_Store. |
Files not reviewed (8)
- man/ReplaceSpecialCharacters.Rd: Language not supported
- man/countDotOrUnderscoreSeparated.Rd: Language not supported
- man/flag.names_list.Rd: Language not supported
- man/format_number_h.Rd: Language not supported
- man/ifExistsElse.Rd: Language not supported
- man/kppc.Rd: Language not supported
- man/parsepvalue.Rd: Language not supported
- man/ppc.Rd: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (brackets) paste0("(", pv, ")") else pv | ||
| if (!isFALSE(prefix)) paste0(prefix, pv) else pv |
| ReplaceRepeatedDots(x) | ||
| if (remove_dots) x <- gsub(x = x, pattern = "\\.", replacement = "") else x |
| ..., | ||
| pasteflg = TRUE, | ||
| collapsechar = ".") { | ||
| .deprecated("parFlags2") |
| #' @export | ||
| parsepvalue <- function(pvalue = 0.01) paste0("(p<", pvalue, ")") | ||
| # Parse p-value from a number to a string. | ||
| parsepvalue <- function(pvalue = 0.01, digits = 2, brackets = F, prefix = F) { |
| parsepvalue <- function(pvalue = 0.01, digits = 2, brackets = F, prefix = F) { | ||
| pv <- paste0("p<=", signif(pvalue, digits = digits ), "") | ||
| if (brackets) paste0("(", pv, ")") else pv | ||
| if (!isFALSE(prefix)) paste0(prefix, pv) else pv | ||
| } |
| #' #' @title flag.names_list | ||
| #' #' @description Returns the name and value of each element in a list of parameters. | ||
| #' #' @param par A list element e.g.: p$umap | ||
| #' #' @examples # flag.names_list(par = p$'umap.n_neighbors') | ||
| #' #' | ||
| #' #' @export | ||
| #' flag.names_list <- function(par) { | ||
| #' if (length(par)) paste(substitute(par), kppu(par), sep = "_")[[3]] | ||
| #' } | ||
|
|
||
|
|
||
| # _________________________________________________________________________________________________ | ||
| #' @title flag.names_list.all.new | ||
| #' @description Returns the name and value of each element in a list of parameters. | ||
| #' @param pl List of parameters, Default: p.hm | ||
| #' @param ls List of parameters (name, value), Default: p.hm | ||
| #' @param sep_name_val Separator name-2-value, Default: "_" | ||
| #' @param sep_elem Separator between elements, Default: "-" | ||
| #' | ||
| #' @export | ||
| flag.names_list.all.new <- function(pl = p.hm) { | ||
| # if (length(pl)) paste(kppu(names(pl)), kppu(pl) , sep = "_") | ||
| if (length(pl)) kppd(paste(names(pl), pl, sep = "_")) | ||
| flag.names_list <- function(ls = p.hm, sep_name_val = "_", sep_elem = "-") { | ||
| if (length(ls)) | ||
| paste(paste(names(ls), ls, sep = sep_name_val), collapse = sep_elem) | ||
| } | ||
| # flag.names_list <- function(ls = p.hm, sep_elem = "_") { | ||
| # if (length(ls)) kppd(paste(names(ls), ls, sep = sep_elem)) | ||
| # } | ||
|
|
||
| flag.names_list.all.new <- function() .Deprecated("flag.names_list") |
| # if (length(ls)) kppd(paste(names(ls), ls, sep = sep_elem)) | ||
| # } | ||
|
|
||
| flag.names_list.all.new <- function() .Deprecated("flag.names_list") |
| dot_count == 0 & usc_count == 0 & ws_count == 0 ~ "none", | ||
| dot_count == usc_count & dot_count == usc_count ~ "undecided" | ||
| dot_count == 0 && usc_count == 0 && ws_count == 0 ~ "none", | ||
| dot_count == usc_count && dot_count == ws_count ~ "undecided" |
| default_msg <- paste(deparse(match.call()[[i + 1]]), "is not TRUE") | ||
|
|
||
| message <- if (!is.null(name) && nzchar(name)) { | ||
| paste(name, "is not TRUE") | ||
| paste(name, "\n", default_msg, "\n") | ||
| } else { | ||
| paste(deparse(match.call()[[i + 1]]), "is not TRUE") | ||
| default_msg |
|
The header of this pull request literally says that it is from the main to the development. Why are you concerned about the opposite happening? See below |
|
@vertesy I can’t apply these changes because the pull request’s branch is the repository’s default branch, which I’m not allowed to push to directly. You can ask me to create a new pull request with the requested changes instead and I'll open a separate PR on a new branch. |
|
The header of this pull request literally says that it is from the main to the development. Why are you concerned about the opposite happening? See below |
No description provided.