Changelog
Source:NEWS.md
statnet.common 4.13.0
CRAN release: 2025-12-16
New utilities
New
testthatpredicate,skip_if_not_checking(), that skips the test if it’s not part of anR CMD check, e.g., if run bytestthat::test_local().New function,
enlist()to wrap an object into a singleton list if it’s not already a list, for various definitions of “list”.New function,
which_top_n(), to return the indices of top or bottomnelements of a vector, with several methods for resolving ties.New function,
split_len()to split a split()-able object by lengths.
statnet.common 4.12.0
CRAN release: 2025-05-30
New utilities
New matrix functions:
qrssolve()to solve linear systems via QR decomposition after scaling, andqrsolve()to do the same without scaling, along withsandwich_qrsolve(),sandwich_qrssolve(),sandwich_ginv(), andsandwich_sginv().New function,
match_names()to replacevector.namesmatch()with more flexible behavior and error checking.New functions,
ERRVL2()andERRVL3()that, unlikeERRVL(), do not require the expressions to be wrapped intry().New function,
replace(), a more pipe-friendly drop-in replacement forbase::replace()for which replacement indices and values can be specified as functions evaluated on the input vector.replace()<-is also implemented, allowing the list to be modified in place.New pair of functions,
arr_to_coo()andarr_from_coo(), to translate between an array and its list of non-default values.New function,
set_diag()to set a diagonal of a matrix to specified values and return (as opposed to modifying it in place).
Enhancements to existing utilities
statnetStartupMessage()now printsRemote:information if the package was installed from a remote.Matrices returned by the
lweighted.*()family of functions now inherit dimensional names.xTAx_eigen()(and thereforexTAx_seigen()) now handle matrix-valued x correctly and check thatxis in the span ofA.Scaling version of matrix operations now use
.Machine$double.xmax/(1 + .Machine$double.eps)as the inverse of the zero diagonal.all_identical()can now use a custom comparison predicate (e.g.,all.equal()), and the use any of the elements in the list as the reference. (Thanks to Michał Bojanowski @mbojan.)
statnet.common 4.11.0
CRAN release: 2025-01-08
New utilities
New function,
modify_in_place(), that attempts to modify the argument of its caller in place. A function can call it to modify its own arguments in place.New function,
log1mexp(x)to computelog(1-exp(-x))minimizing the loss of precision. R provides a C macrolog1mexp(x)but not the corresponding R wrapper.
Enhancements to existing utilities
- The behavior of
trim_env()has changed: if no variables are to be copied in, the environment is set directly tobaseenv().
statnet.common 4.10.0
CRAN release: 2024-10-06
New utilities
New linear algebra utilities:
ginv_eigen(), which performs generalised inverse via eigendecomposition rather than SVD, to be used bysginv()ifsnnd=TRUE; andxTAx_eigen()andxTAx_seigen()to evaluate the inverse quadratic form using eigendecomposition.A new function
var.mcmc.list()“method” to evaluate the covariance matrix for anmcmc.listwithout constructing a large matrix.
Enhancements to existing utilities
colMeans.mcmc.list()“method” no longer constructs a large matrix when calculating.lweighted.var()andlweighted.cov()now take an additional argumentonerow=to specify what they should return (NA, 0, or something else) if the input matrix has one row.
Bug fixes
as.cntrol.list.list()and hencesnctrl()no longer clobbers nested controls, e.g.,control.ergm(SAN=control.san(...),...).To facilitate support for earlier versions of R, avoid using the built-in pipe (
|>) for now.
statnet.common 4.9.0
CRAN release: 2023-05-24
New utilities
A new function,
lweighted.cov(), to compute weighted covariance between two matrices or vectors.New linear algebra utilities,
is.SPD(),sandwich_solve(),sandwich_ssolve(),sginv(),snearPD(),srcond(),ssolve(),xAxT(),xTAx(),xTAx_qrsolve(),xTAx_qrssolve(),xTAx_solve(), andxTAx_ssolve()moved fromergmand documented.
Bug fixes
- In
handle.controls(), arguments that arematch.arg()-ed are now evaluated in the correct frame.
statnet.common 4.8.0
CRAN release: 2023-01-24
New utilities
- A helper function
unused_dots_warning()is exported that works withrlang::check_dots_used()to print an informative message.
statnet.common 4.7.0
CRAN release: 2022-09-08
New utilities
- An S3 class
term_listfor storing terms extracted from a formula, bylist_rhs.formula()and others, containing information about each term’s sign and environment. Concatenation, indexing, and print methods are implemented.
Bug fixes
-
list_rhs.formula()can now handleNULLterms on the RHS.
statnet.common 4.6.0
CRAN release: 2022-05-02
New utilities
- An implementation of Welford’s online algorithm for calculating sample mean and variance has been added as a class
Welfordthat implements methodupdate()and maintains elements$n,$means,$SSDs, and$vars.
Bug fixes
snctrl()was issuing a warning twice when called with a misspelled argument.deInf()now handlesNULLinput.in
locate_function()a subtle bug has been fixed in handling of visible as opposed to invisible objects.
statnet.common 4.5.0
CRAN release: 2021-06-05
New utilities
ergm’s term locator functions (locate_function()andlocate_prefixed_function()) have been moved fromergm.A new function,
default_options(), a wrapper aroundoptions()that drops options already set.A new function,
as.control.list()generic and methods which take an R list and call an appropriatecontrol.*()function on it.check.control.class()now first runs the control argument throughas.control.list()and overwrites, socontrol=arguments to many functions can be plain lists.A new function,
simplify_simple(), which takes a list and returns an atomic vector if the elements of the list are atomic and of length 1, with particular handling forNULLand empty (0-length) elements.A new function,
snctrl()(StatNet ConTRoL), designed so that argument completion will complete all available control functions. Looking up its help (?snctrl) produces a dynamic list of all control parameters and their packages and control functions that is updated as packages are loaded and unloaded.A new function,
handle.controls(), that performs the most normal functions in acontrol.*()function.Two trivial helper functions,
base_env()andempty_env(), to replace an object’s environment withbaseenv()andemptyenv(), respectively.A new function,
fixed.pval()that wrapsbase::format.pval()with better default arguments.A reimplementation of
attr()is exported, which disables partial matching by default.
Enhancements to existing utilities
statnetStartupMessage()now first looks for acomment=(affil=...)for the contributor’s affiliation, before using e-mail.Improved output formatting for
.Deprecate_once().append_rhs.formula()now accepts NULL as the first argument, in which case it creates a new formula, and takes an additonal argumentenv=, which is used as this new formula’s environment.
Miscellaneous changes
rleutilities are no longer reexported.statnet.commonno longer depends onpurrr.statnetStartupMessage()has been simplified.
statnet.common 4.4.0
New utilities
split()methods for matrices and arrays, to split them along a margin.trim_env(), a generic that will replace an environment (possibly attached to another object) with a sub-environment containing only objects whose names are specified.A
diff()method for control lists and aprint()method for the resulting differences.deInf(), to replace.deinf()in packageergm.A
compress()generic, acompress()method for RLEs, and adoNotCompressargument torep.rle(). Bothcompact.rle()and thedoNotCompactargument torep.rle()are now deprecated.
Enhancements to existing utilities
Various optimizations have been made to RLEs.
nonsimp_update.formula()now handles both one and two sided formulas; it also now copies all names except...whenfrom.new = TRUE.
Bug fixes
-
str.rle()now works despite the overriddenlength()method.
statnet.common 4.3.0
CRAN release: 2019-06-02
New utilities
EVL(), a family of functions likeNVL(), that treat any object of length 0 asNULL.once(), apurrr-style adverb that wraps a function to only evaluate the first time it’s called with a given configuration of arguments.persistEval()andpersistEvalQ()to retry evaluating a given expression a specified number of times.
Bug fixes
- In
forkTimeout(), don’t collect a process twice. Thanks to Tomas Kalibera for suggesting the fix.
statnet.common 4.2.0
CRAN release: 2019-01-08
New utilities
.Deprecate_once()calls.Deprecated(), passing all its arguments through, but only the first time it’s called..Deprecate_method()calls.Deprecated(), but only if a method has been called by name, i.e.,METHOD.CLASS.forkTimeout()evaluates an R expression with a hard time limit (except on Windows) by forking a process. UnlikesetTimeLimit(), it enforces the limit even on native code.ult()is a convenience function that extracts or replaces elements of a list indexed from the end.
statnet.common 4.1.4
CRAN release: 2018-06-22
New utilities
despace()removes whitespace from a string.Pseudo-methods
colMeans.mcmc.list(),sweep.mcmc.list(), andlapply.mcmc.list()(migrated from theergmpackage).filter_rhs.formula()selectively deletes terms in on the RHS of a formula.eval_lhs.formula()extracts the LHS of the formula and evaluates it in the specified environment.message_print()formats its arguments as if forprint()orshow()methods, but then prints to stderr likemessage().
Enhancements to existing utilities
paste.and()now takes an additionalcon=argument, allowing a conjunction other than “and” to be used.ERRVL()now uses lazy evaluation and lets the user dot-substitute the previous argument’s try-error into the next argument.
Bug fixes
Printing for control lists now works for function arguments.
A number of improvements to
rlemethods.
statnet.common 4.0.0
CRAN release: 2017-08-16
The package now uses
Roxygenfor documentation.term.list.formula()output format has been changed, since support of attributes on symbols is being deprecated.A library of methods has been added for the base
rleclass, implementing concatenation, compaction, and a number of binary operations.all_same()has been moved from ergm and renamed toall_identical().A new assignment method
NVL()<-overwrites a variable if its value is NULL.A set of classes and functions for manipulating and efficiently performing calculations on dense matrices or vectors with weighted rows or elements (possibly on the log scale) has been added.
New control parameter helper function, control.remap() has been added. Autodetection of function names by
set.control.class()andcheck.control.class()has been deprecated and now results in a warning.Improvements to the compressed data frame code, including an order() generic.
Miscellaneous robustifications added.
Native routine registration has been added.
statnet.common 3.3.0
CRAN release: 2015-10-24
append.rhs.formula(),vectors.namesmatch(),term.list.formula(), andergm.update.formula()(renamed tonosimp.update.formula()) moved fromergm.Skye Bender-deMoll has been added as a contributor.
statnet.common 3.2.3
CRAN release: 2015-08-05
ERRVL()moved fromergm.Some
NAMESPACEand other fixes to pass CRAN checks.
statnet.common 3.1.0
- Initial release, incorporating the control class framework (
set.control.class(),check.control.class(),print.control.list()); startup message framework;NVL();sort.data.frame();compress.data.frame();paste.and(); citation utilities framework; andopttest()framework.