Skip to contents

thisutils (development version)

  • feat:
    • Add check_r(strict = TRUE) to stop with an install hint if a package remains unavailable.
    • Add sum_columns_by_group() to sum columns by group in order of first appearance, preserving sparsity for sparse inputs.
  • compatibility:
    • Preserve the position of the verbose argument in check_r().

thisutils 0.5.3

CRAN release: 2026-10-28

  • feat:
    • Add fit_trends() for GAM and PreTSA trends, with fit scores, peak and valley times, and raw and adjusted P-values. Optional fitted values and bounds follow input order. GAM bounds use +/- 2 standard errors on the link scale. PreTSA bounds equal the fitted values.
    • Add local_verbose() to set log_message.verbose for the calling scope and restore it on exit.
    • Add --demo to the Python and Shell log_message scripts, replacing the standalone examples.
  • compatibility:
    • Replace inst/python/ with inst/scripts/ for Python and Shell helpers. The scripts ignore LOG_MESSAGE_VERBOSE, default to visible output, and honour NO_COLOR.
    • ask prompts and error signals remain active with verbose = FALSE in R, Python, and Shell. R uses explicit verbose, then options(log_message.verbose), then visible output.
    • invoke_fun() builds calls faster and requires a list, pairlist, or NULL for argument values. Calls with arguments use a child environment that contains side effects and temporary symbols. Captured calls leave large objects in that environment and may be unreplayable. String function names and explicit missing arguments retain their behaviour.
  • fix:
    • Keep nonconstant zero-sum features in PreTSA trend significance tests and return a P-value of one for constant features.
    • Include zero values in fast_aggregate() means and align them with aggregate_matrix() means.
    • Apply grouped maximum, minimum, and custom summaries separately to each column, preserving dimensions and names for single-row groups.
    • Preserve missing values when sparse maxima use na.rm = FALSE, and respect symmetric and triangular sparse matrix storage.
    • Recognize pak’s github:: prefix in installed repository metadata when checking package sources, avoiding unnecessary reinstallation.
    • Keep the original check_r() installation error when the optional remotes package is not installed.
    • Report PSOCK worker exits during send or result collection as parallelize_worker_error across locales. Propagate the original serialization error when the worker is alive.
  • docs:
    • List local_verbose in the pkgdown reference index.

thisutils 0.5.2

  • feat:
    • Add %|||% for NULL or zero-length fallbacks. %ss% remains NULL-only so it does not mask rlang %||%.
    • Add detect_cores(), which reports the number of CPU cores and clamps it to an optional max_threads bound, falling back to 1 when the probe fails. Supplying num_session gives the worker-count heuristic that parallelize_fun() uses, so core detection lives in one place.
    • Add col_maxs(), row_maxs(), fast_aggregate(), and aggregate_matrix() for dense and sparse matrices. Sparse maxima treat implicit zeros as zero.
  • performance:
    • Reduce per-task overhead by sharing message capture and nested-worker setup within each scheduled batch.
    • Send smaller PSOCK exports and only the assigned inputs and random-number streams per batch. Use native serialization for same-host workers.
    • Skip lifecycle logging with verbose = FALSE. Verbose output formats the first 20 distinct error types and results retain every error object.
  • fix:

thisutils 0.5.0

CRAN release: 2026-08-21

  • compatibility:
    • Preserve the historical matrix_to_table(keep_zero = TRUE) default. Compact table output remains an explicit choice.
    • run_sparse_topk_by_column() still ranks stored entries and fills missing ranks with NA indices and zero values. run_sparse_topk_stored() fills both indices and values with NA. run_sparse_topk() includes implicit zeros by default.
  • feat:
    • Add run_dense_topk() with an explicit by = "col" or by = "row" direction and a decreasing top-k default.
    • Add run_sparse_topk() and run_sparse_topk_stored() with an explicit by = "col" or by = "row" direction. The earlier column-wise names remain available as compatibility wrappers.
    • Allow parallelize_fun(verbose = TRUE, progress = FALSE) to retain standardized log_message() lifecycle output without a dynamic terminal progress bar.
    • Make Pearson sparse_cor() blockwise and add correlation threshold, dense working-memory, and opt-in sparse output-size controls. The output limit defaults to Inf for compatibility. Spearman and Kendall paths now check their dense allocation boundary before conversion.
    • Expose exact LISI neighbor-search strategy, C++ thread count, and dense input-memory controls through compute_lisi().
  • fix:
    • Detect cancellation-prone row variance calculations and recompute only the affected dense or sparse rows with a stable two-pass calculation, preserving the existing fast path for ordinary inputs.
    • Replace infinite correlations with zero when remove_inf = TRUE.
    • Summarize failed structured or matrix-valued tasks by their task name or shape, preventing verbose error reporting from masking the original worker error.
  • docs:
    • Document sparse semantics and memory and CPU limits. Add workflow vignettes, reporting examples, and a benchmark plan.
  • tests:
    • Verify fork worker cleanup after external interruption and cover the default PSOCK backend with an in-process interrupt test.

thisutils 0.4.9

CRAN release: 2026-08-04

thisutils 0.4.8

  • feat:
  • fix:
    • Default check_r() to dependencies = NA to install hard dependencies and skip Suggests.
    • Report the full check_r() installation error chain once per package, with ANSI escape codes removed.
    • Retry GitHub packages with remotes when pak cannot parse a malformed DESCRIPTION file.

thisutils 0.4.6

  • feat:
    • Remove compute_simpson_index.

thisutils 0.4.5

CRAN release: 2026-04-24

  • feat:
    • Add collapse_sparse_rows(): collapse sparse matrix rows by group while preserving sparse output and row order.
    • Update compute_lisi(): simplify nearest-neighbor backend selection by removing the hnsw path and using a more conservative "auto" strategy that prefers the package’s exact backend only for very small problems.
    • Improve parallelize_fun(): refactor verbose multi-core execution to collect results dynamically while preserving input order and progress reporting across uneven workloads.
    • Improve log_message(): allow explicit verbose to override the global option and normalize captured cli alerts emitted inside expr.
  • fix:
    • Harden normalization() against degenerate inputs so zero-variance or zero-sum vectors return stable values instead of NaN/Inf.
    • Fix matrix_to_table() sparse keep_zero = TRUE handling to match dense output more reliably and make equal-magnitude sorting deterministic.
    • Fix table_to_matrix() to aggregate duplicate row/column coordinates consistently in both dense and sparse output paths.
    • Update package startup behavior to stay silent in non-interactive sessions and when verbose logging is disabled.
    • Update package installation helpers to use pak::pkg_install()/pak::pkg_remove() with explicit library handling.
  • docs:
  • tests:
    • Cover sparse aggregation, LISI backends, matrix conversion, degenerate normalization, parallel execution, and logging in regression tests.

thisutils 0.4.4

CRAN release: 2026-04-02

  • feat:
    • Add compute_lisi(): compute per-cell Local Inverse Simpson’s Index (LISI) scores for categorical variables.
    • Enhance log_message(): add optional expr support to capture standard output, messages, and warnings from another expression and re-print them with log_message() formatting while returning the evaluated result.
    • parallelize_fun():
      • Suppress C/C++ level stderr output (e.g., "Error : Not a matrix.") and warnings during function execution in parallelize_fun() via stderr redirection and suppressWarnings().
      • Group error reporting by message: identical errors are now collapsed into a single line with count and up to 3 example task names, instead of printing every failure individually.
      • Add progress_bar_width to parallelize_fun() for direct progress bar width control; default width is now 10.
  • fix:
    • parallelize_fun()
      • Fix result length mismatch when cores = 1: use output_list[i] <- list(result) instead of output_list[[i]] <- result to prevent NULL returns from shrinking the output list.
      • Fix multi-core result ordering in verbose mode: results are now written back by original index so output order and assigned names stay aligned with input.
      • Fix core detection fallback: when parallel::detectCores(logical = FALSE) is unavailable or returns an invalid value, execution now falls back safely to at least one worker instead of failing.

thisutils 0.4.2

CRAN release: 2026-02-23

  • feat:
    • Add check_ci_env(): detect whether the current session should be treated as CI/pkgdown context; returns TRUE for interactive sessions and for GitHub Actions when GITHUB_ACTIONS=true and GITHUB_WORKFLOW=pkgdown (case-insensitive), otherwise returns FALSE.
    • Add is_outlier(): detect outlier indices using median and MAD-based bounds (nmads, constant) with type = "both"|"lower"|"higher; NA values are also included in the returned index vector.
    • Export check_pkg_status(): make the package/version checker available as a public API; it checks installation status in a target library (lib) and optionally verifies exact version match when version is provided.

thisutils 0.4.1

  • feat:

thisutils 0.4.0

  • feat:
    • Add check_r(): check and install R packages from CRAN, Bioconductor, or GitHub; supports version pinning (pkg@version or pkg==version) and optional force reinstall; uses pak::pak() for installation with configurable lib and dependencies.
    • Add remove_r(): check and remove installed R packages from the given library; uses pak::pkg_remove(); skips packages that are not installed and reports success or failure per package.

thisutils 0.3.9

  • feat:
    • Fix add_pkg_file() dependency management: cli dependency is now added with correct comma separation, and both Imports and Suggests sections are automatically sorted alphabetically. The Suggests section is now enforced to follow Imports.

thisutils 0.3.8

  • feat:
    • Improve add_pkg_file() flow: better metadata extraction/logging from DESCRIPTION, and smarter logo generation fallback when figlet fails. Generated package files now include @useDynLib only when src/ exists.
    • Refresh startup messages: .onAttach() now shows package version, release date, and website link in both generated package files.

thisutils 0.3.7

thisutils 0.3.6

CRAN release: 2026-01-08

  • feat:
    • Fix warning about ‘ATTRIB’ from check results of CRAN.

thisutils 0.3.5

  • feat:
    • Simplify parallelize_fun() function: Unified progress bar creation logic by removing conditional branches and using a single consistent format. Updated progress bar format string for better readability and consistency.
    • Add get_namespace_fun() function.

thisutils 0.3.4

  • feat:
    • Enhance log_message() function: Added new "ask" message type for interactive user prompts. When message_type = "ask", the function uses utils::askYesNo() to prompt the user and returns TRUE for Yes, FALSE for No, and NA for Cancel.
    • Optimize parallelize_fun() function: Improved progress bar status display in parallel processing mode. Now shows only the first item name/value with ellipsis (“…”) instead of concatenating all chunk items, resulting in cleaner and more concise progress display.

thisutils 0.3.3

  • feat:
    • Refactor internal helper functions in log_message() and add_pkg_file(): Converted private helper functions (prefixed with .) to public functions, improving code accessibility and maintainability. Functions affected include build_message(), validate_params(), output_message(), style_formatting(), plain_text_output(), get_caller_call(), extract_function_name(), make_color_style(), check_color(), and generate_content().
  • docs:

thisutils 0.3.2

  • feat:
    • Change default value of timestamp_style parameter in log_message() function from TRUE to FALSE for cleaner default output.

thisutils 0.3.1

CRAN release: 2025-11-17

  • docs:
    • Update figlet() references to use HTTPS, addressing CRAN incoming NOTE.

thisutils 0.3.0

  • feat:
    • Enhance log_message() function: Added new plain_text parameter to suppress level, symbol, timestamp, and message type formatting while preserving color and multiline settings, allowing for cleaner text-only output.
    • Improve add_pkg_file() function: Enhanced message types and formatting, using more appropriate message types (warning, running) and improved file references in log messages.

thisutils 0.2.5

  • feat:
    • Optimize check_sparsity() function: Improved calculation logic by computing total counts upfront, avoiding redundant calculations for sparse and non-sparse matrices.
    • Optimize normalization() function: Enhanced max_min and maximum methods by caching min/max values to avoid repeated calculations.
    • Improve code quality in parallelize_fun(): Replaced sapply() with vapply() for type-safe return values and optimized error handling logic.
    • Optimize P-value combination functions (meanp(), sump(), votep()): Extracted validp variable to avoid repeated indexing and improved code efficiency.
    • Enhance sump() function: Replaced loop-based calculation with vectorized operations for better performance.
    • Improve capitalize() and unnest_fun() functions: Replaced sapply() with vapply() for type safety.
    • Enhance add_pkg_file() function: Now automatically checks for the existence of src directory and only adds @useDynLib directive when src folder is present in the package environment.

thisutils 0.2.4

  • feat:
    • Enhance log_message() function: Now automatically handles non-character objects (e.g., data.table, data.frame) by formatting them with capture.output(print(...)), allowing direct object input without manual string conversion.

thisutils 0.2.3

  • feat:
    • Rewrite matrix_to_table() C++ implementation to iterate dgCMatrix slots directly, avoiding dense conversion and reducing memory/time cost on large sparse matrices.
    • Align keep_zero/threshold semantics across C++/R: retain entries if abs(value) >= threshold; zeros are retained only when keep_zero = TRUE and threshold == 0.

thisutils 0.2.2

  • feat:
    • Enhance parallelize_fun() function: Added support for named vectors and vectors in progress display, showing current processing item names or values in the progress bar. Improved progress bar formatting with status information and enhanced parallel processing progress updates.
    • Improve visual formatting in add_pkg_file() and thisutils-package.R: Enhanced separator line display with grey color styling using cli::col_grey() for better visual consistency.

thisutils 0.2.1

  • feat:
    • Enhance add_pkg_file() function: Added automatic dependency checking to ensure cli package is included in DESCRIPTION file, and automatic pkgdown configuration checking to ensure proper package overview section setup.

thisutils 0.2.0

CRAN release: 2025-10-06

  • feat:
    • Add package logo.
    • Add get_verbose() function: New exported function to get verbose option from global options or local arguments, providing better control over message display.
    • Enhance .onAttach() function: Now respects verbose settings and only displays startup messages when verbose mode is enabled, improving user experience.
    • Update add_pkg_file() function: Generated .onAttach() function now includes verbose check using get_verbose(), ensuring consistency with package behavior.
  • docs:

thisutils 0.1.9

  • feat:
    • Remove list_figlet_fonts() and rescale() functions.

thisutils 0.1.7

  • feat:
    • Refactor add_pkg_file() function: Simplified function parameters by removing manual parameter inputs and automatically extracting all package information from DESCRIPTION file. Enhanced error handling and improved logging messages.
    • Enhance parallelize_fun() function with robust error handling: Added clean_result parameter to control automatic removal of failed results, and throw_error parameter to control detailed error message display. Functions now gracefully handle partial failures without stopping execution.
    • Add parse_inline_expressions() function: High-performance inline expression parser that evaluates {} expressions while preserving CLI formatting markers like {.val ...}.
    • Enhance log_message() function: Add new "running" message type with orange circle dotted symbol (◌) to indicate ongoing processes.

thisutils 0.1.6

thisutils 0.1.5

CRAN release: 2025-09-11

  • feat:
    • Update add_pkg_file() function. Now, add_pkg_file() can automatically extract information of R package from DESCRIPTION file and save it in the ./R/ folder.

thisutils 0.1.4

  • feat:
    • Delete str_wrap() function.

thisutils 0.1.3

thisutils 0.1.1

thisutils 0.0.9

thisutils 0.0.8

  • docs:
    • Update documentation for some functions.