R Under development (unstable) (2023-12-15 r85690 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # File tests/requireNamespaceTest.R in package ergm, part of the > # Statnet suite of packages for network analysis, https://statnet.org . > # > # This software is distributed under the GPL-3 license. It is free, > # open source, and has the attribution requirements (GPL Section 7) at > # https://statnet.org/attribution . > # > # Copyright 2003-2023 Statnet Commons > ################################################################################ > library(network) 'network' 1.18.2 (2023-12-04), part of the Statnet Project * 'news(package="network")' for changes since last version * 'citation("network")' for citation information * 'https://statnet.org' for help, support, and other information > data(flo) > > # Also, while we are at it, test the options setting in .onLoad(). > options(ergm.eval.loglik=FALSE) # .onLoad() should not clobber this. > > requireNamespace('ergm') # Load the namespace, but don't attach the package. Loading required namespace: ergm > > # Check that options are either set to default or preserved. > stopifnot(getOption("ergm.eval.loglik")==FALSE) > stopifnot(getOption("ergm.loglik.warn_dyads")==TRUE) > > # run a summary > ergm::summary_formula(as.network(flo)~density) density 0.1666667 > > # try a user-defined ergm term > InitErgmTerm.myedges<-ergm:::InitErgmTerm.edges > ergm::summary_formula(as.network(flo)~myedges) edges 40 > > # actually run ergm() > data(sampson, package="ergm") > fit <- ergm::ergm(samplike~edges) Starting maximum pseudolikelihood estimation (MPLE): Obtaining the responsible dyads. Evaluating the predictor and response matrix. Maximizing the pseudolikelihood. Finished MPLE. > stopifnot(isTRUE(all.equal(-log(1/(network.edgecount(samplike)/network.dyadcount(samplike))-1), coef(fit), check.attributes=FALSE))) > > library(ergm) # Now, attach the package. 'ergm' 4.6.0 (2023-12-17), part of the Statnet Project * 'news(package="ergm")' for changes since last version * 'citation("ergm")' for citation information * 'https://statnet.org' for help, support, and other information 'ergm' 4 is a major update that introduces some backwards-incompatible changes. Please type 'news(package="ergm")' for a list of major changes. > # Check that options are either set to default or preserved. > stopifnot(getOption("ergm.eval.loglik")==FALSE) > stopifnot(getOption("ergm.loglik.warn_dyads")==TRUE) > > proc.time() user system elapsed 2.07 0.10 2.17