Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

statnetStartupMessage

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


Description

This function uses information returned by packageDescription to construct a standard package startup message according to the policy of the Statnet Project. To determine institutional affiliation, it uses a lookup table that maps domain names to institutions. (E.g., *.uw.edu or *.washington.edu maps to University of Washington.)

Usage

statnetStartupMessage(pkgname, friends, nofriends)

Arguments

pkgname

Name of the package whose information is used.

friends

This argument is required, but will only be interpreted if the Statnet Project policy makes use of "friendly" package information.

A character vector of names of packages whose attribution information incorporates the attribution information of this package, or TRUE. (This may, in the future, lead the package to suppress its own startup message when loaded by a "friendly" package.)

If TRUE, the package considers all other packages "friendly". (This may, in the future, lead the package to suppress its own startup message when loaded by another package, but print it when loaded directly by the user.)

nofriends

This argument controls the startup message if the Statnet Project policy does not make use of "friendly" package information but does make use of whether or not the package is being loaded directly or as a dependency.

If TRUE, the package is willing to suppress its startup message if loaded as a dependency. If FALSE, it is not.

Value

A string containing the startup message, to be passed to the packageStartupMessage call or NULL, if policy prescribes printing 's default startup message. (Thus, if statnetStartupMessage returns NULL, the calling package should not call packageStartupMessage at all.)

Note that arguments to friends and nofriends are merely requests, to be interpreted (or ignored) by the statnetStartupMessage according to the Statnet Project policy.

See Also

packageDescription

Examples

## Not run: 
.onAttach <- function(lib, pkg){
  sm <- statnetStartupMessage("ergm", friends=c("statnet","ergm.count","tergm"), nofriends=FALSE)
  if(!is.null(sm)) packageStartupMessage(sm)
}

## End(Not run)

statnet.common

Common R Scripts and Utilities Used by the Statnet Project Software

v4.4.1
GPL-3 + file LICENSE
Authors
Pavel N. Krivitsky [aut, cre] (<https://orcid.org/0000-0002-9101-3362>), Skye Bender-deMoll [ctb]
Initial release
2020-10-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.