Learn R Programming

statnet.common (version 4.13.0)

Common R Scripts and Utilities Used by the Statnet Project Software

Description

Non-statistical utilities used by the software developed by the Statnet Project. They may also be of use to others.

Copy Link

Version

Install

install.packages('statnet.common')

Monthly Downloads

43,122

Version

4.13.0

License

GPL-3 + file LICENSE

Maintainer

Pavel N. Krivitsky

Last Published

December 16th, 2025

Functions in statnet.common (4.13.0)

diff.control.list

Identify and the differences between two control lists.
empty_env

Replace an object's environment with a simple, static environment.
handle.controls

Handle standard control.*() function semantics.
formula.utilities

Functions for Querying, Validating and Extracting from Formulas
control.list.accessor

Named element accessor for ergm control lists
message_print

print objects to the message output.
mcmc-utilities

Utility operations for mcmc.list objects
replace

Replace values in a vector according to functions
set.control.class

Set the class of the control list
locate_function

Locate a function with a given name and return it and its environment.
is.SPD

Test if the object is a matrix that is symmetric and positive definite
snctrl_names

Helper functions used by packages to facilitate snctrl updating.
modify_in_place

Modify the argument in the calling environment of the calling function
once

Evaluate a function once for a given input.
statnet.cite

CITATION file utilities for Statnet packages (DEPRECATED)
statnetStartupMessage

Construct a "standard" startup message to be printed when the package is loaded.
fixed.pval

Format a p-value in fixed notation.
skip_if_not_checking

simplify_simple

Convert a list to an atomic vector if it consists solely of atomic elements of length 1.
opttest

Optionally test code depending on environment variable.
paste.and

Concatenates the elements of a vector (optionaly enclosing them in quotation marks or parentheses) adding appropriate punctuation and conjunctions.
which_top_n

Top or bottom n elements of a vector
sweep_cols.matrix

Suptract a elements of a vector from respective columns of a matrix
control.remap

Overwrite control parameters of one configuration with another.
term_list

A helper class for list of terms in an formula
vector.namesmatch

reorder vector v into order determined by matching the names of its elements to a vector of names
logspace.utils

Utilities for performing calculations on logarithmic scale.
default_options

Set options() according to a named list, skipping those already set.
deInf

Truncate values of high magnitude in a vector.
set_diag

Return the matrix with diagonal set to a specified value
sign<-

A generic for setting the sign of an object
wmatrix

A data matrix with row weights
split_len

Split a list or some other split()-able object by lengths
ssolve

Wrappers around matrix algebra functions that pre-scale their arguments
forkTimeout

Evaluate an R expression with a hard time limit by forking a process
persistEval

Evaluate an expression, restarting on error
print.control.list

Pretty print the control list
snctrl

Statnet Control
ult

Extract or replace the ultimate (last) element of a vector or a list, or an element counting from the end.
trim_env

Make a copy of an environment with just the selected objects.
wmatrix_weights

Set or extract weighted matrix row weights
split.array

A split() method for array and matrix types on a margin.
unused_dots_warning

An error handler for rlang::check_dots_used() that issues a warning that only lists argument names.
match_names

Construct a named vector with semantics useful for parameter vectors
order

Implement the sort and order methods for data.frame and matrix, sorting it in lexicographic order.
xTAx

Common quadratic forms
unwhich

Construct a logical vector with TRUE in specified positions.
check.control.class

Ensure that the class of the control list is one of those that can be used by the calling function
arr_from_coo

Conveniently covert between coordinate-value and array representations
Welford

A Welford accumulator for sample mean and variance
as.control.list

Convert to a control list.
attr

A wrapper for base::attr which defaults to exact matching.
compress_rows

A generic function to compress a row-weighted table
all_identical

Test if all items in a vector or a list are identical.
compress_rows.data.frame

"Compress" a data frame.
NVL

ERRVL

Attempt a series of statements and return the first one that is not an error.
enlist

Wrap an object into a singleton list if not already a list
envir

A generic for querying and setting an object's environment
despace

A one-line function to strip whitespace from its argument.
deprecation-utilities

Utilities to help with deprecating functions.