Reliable Utilities for Reusable Research Workflows

Provides reusable building blocks for research packages across matrix representation, numerical computation, neighborhood evaluation, controlled execution, and runtime interoperability. Core tools preserve declared sparse semantics, expose dense-memory and output boundaries, standardize neighborhood and classification results, and align serial and parallel result and error behavior. Additional helpers support structured messages, optional dependency checks, and common statistical workflows.


thisutils

CRAN_Status_Badge Conda Version R-hub R-CMD-check test-coverage pkgdown RStudio CRAN mirror downloads

Introduction

thisutils provides reliable building blocks for research workflows: sparse-matrix conversion and top-k selection, correlations, neighborhoods and LISI scores, repeated execution with structured messages, and optional dependency checks — with explicit semantics and bounded resource use.

Installation

Install CRAN version:

install.packages("thisutils")
# or
if (!require("pak", quietly = TRUE)) {
  install.packages("pak")
}
pak::pak("thisutils")

Install development version from GitHub use pak:

if (!require("pak", quietly = TRUE)) {
  install.packages("pak")
}
pak::pak("mengxu98/thisutils")

Quick start

library(Matrix)
library(thisutils)

x <- Matrix(
  c(-3, 0, 2, -1, 4, 0),
  nrow = 3,
  sparse = TRUE,
  dimnames = list(paste0("r", 1:3), paste0("c", 1:2))
)

# Implicit zeros for ordinary matrices; stored entries only for graphs
run_sparse_topk(x, k = 2, by = "col")
run_sparse_topk_stored(x, k = 2, by = "col")

# Blockwise correlation with a bounded dense working block
sparse_cor(simulate_sparse_matrix(200, 50), threshold = 0.2, block_size = 64)

# Repeat tasks with aligned serial/parallel results and per-input seeds
parallelize_fun(
  list(first = x, second = x),
  function(mat) thisutils::sparse_cor(mat, threshold = 0.2, block_size = 64),
  cores = 2,
  backend = "psock",
  seed = 2026
)

See the function reference for the complete API, and run vignette("research-package-workflows", package = "thisutils") for a connected example installed with the package.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("thisutils")

0.5.0 by Meng Xu, a month ago


https://mengxu98.github.io/thisutils/


Report a bug at https://github.com/mengxu98/thisutils/issues


Browse source code at https://github.com/cran/thisutils


Authors: Meng Xu [aut, cre] , Haoliang Zhu [aut]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports callr, cli, methods, Matrix, pak, parallel, ps, Rcpp, rlang, stats, utils

Suggests BiocNeighbors, knitr, remotes, rmarkdown, testthat

Linking to cli, Rcpp


Imported by inferCSN, thisplot.


See at CRAN