Learn R Programming

statnet.common (version 4.11.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

28,640

Version

4.11.0

License

GPL-3 + file LICENSE

Maintainer

Pavel N. Krivitsky

Last Published

January 8th, 2025

Functions in statnet.common (4.11.0)

as.control.list

Convert to a control list.
attr

A wrapper for base::attr which defaults to exact matching.
check.control.class

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

A Welford accumulator for sample mean and variance
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.
control.list.accessor

Named element accessor for ergm control lists
despace

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

Modify the argument in the calling environment of the calling function
control.remap

Overwrite control parameters of one configuration with another.
once

Evaluate a function once for a given input.
diff.control.list

Identify and the differences between two control lists.
deInf

Truncate values of high magnitude in a vector.
handle.controls

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

Functions for Querying, Validating and Extracting from Formulas
forkTimeout

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

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

Replace an object's environment with a simple, static environment.
logspace.utils

Utilities for performing calculations on logarithmic scale.
fixed.pval

Format a p-value in fixed notation.
mcmc-utilities

Utility operations for mcmc.list objects
is.SPD

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

print objects to the message output.
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.
set.control.class

Set the class of the control list
simplify_simple

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

Helper functions used by packages to facilitate snctrl updating.
order

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

Construct a logical vector with TRUE in specified positions.
snctrl

Statnet Control
persistEval

Evaluate an expression, restarting on error
vector.namesmatch

reorder vector v into order determined by matching the names of its elements to a vector of names
trim_env

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

term_list

A helper class for list of terms in an formula
split.array

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

ult

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

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

Set options() according to a named list, skipping those already set.
deprecation-utilities

Utilities to help with deprecating functions.
statnet.cite

CITATION file utilities for Statnet packages (DEPRECATED)
print.control.list

Pretty print the control list
wmatrix

A data matrix with row weights
statnetStartupMessage

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

Set or extract weighted matrix row weights
unused_dots_warning

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

Suptract a elements of a vector from respective columns of a matrix
xTAx

Common quadratic forms