diff --git a/inst/shiny/statnetWeb/global.R b/inst/shiny/statnetWeb/global.R index 9c5d1a9..a58fe66 100644 --- a/inst/shiny/statnetWeb/global.R +++ b/inst/shiny/statnetWeb/global.R @@ -74,11 +74,12 @@ cugstats <- function(x, term, directed, loops) { # Takes an ergm object and gathers some of the information from # summary.ergm, in preparation to be passed to the function # coef.comparison. +# NOTE: this is not very robust to changes in the fit object structure ergm.info <- function(object) { - coefs <- object$coef - terms <- names(object$coef) - coefmatrix <- summary(object)$coefs - pval <- coefmatrix[, 4] + coefs <- coef(object) + terms <- names(coefs) + coefmatrix <- summary(object)$coefficients + pval <- coefmatrix[, 5] signif.stars <- symnum(pval, corr = FALSE, na = FALSE, cutpoints = c(0, 0.001, 0.01, 0.05, 0.1, 1), symbols = c("***", "**", "*", ".", " "), legend = F) @@ -90,8 +91,8 @@ ergm.info <- function(object) { ans[i] <- starredcoef[count] count <- count + 1 } - ans$AIC <- format(summary(object)$aic, digits = 3) - ans$BIC <- format(summary(object)$bic, digits = 3) + ans$AIC <- format(AIC(object)[1], digits = 3) + ans$BIC <- format(BIC(object)[1], digits = 3) ans }