[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] get network centralization via boot()

From: John Erwin Banez
Subject: [igraph] get network centralization via boot()
Date: Wed, 28 Feb 2018 10:00:41 +0800

How is it possible to input "centr_degree" in boot()?

My code so far is:

g1 <- sample_pa_age(5000, pa.exp=1, aging.exp=0, aging.bin=1000)
deg = boot(data=""> statistic=centr_degree, R=5000)

but is getting:

Error in match.arg(arg = arg, choices = choices, several.ok = several.ok) : 
  'arg' must be of length 1

I also tried "defining" the function to be used in "statistic=":

cntr <- function (graph, mode = c("all", "out", "in", "total"), loops = TRUE, 
    normalized = TRUE) 
    if (!is_igraph(graph)) {
        stop("Not a graph object")
    mode <- switch(igraph.match.arg(mode), out = 1, `in` = 2, 
        all = 3, total = 3)
    loops <- as.logical(loops)
    normalized <- as.logical(normalized)
    res <- .Call(C_R_igraph_centralization_degree, graph, mode, 
        loops, normalized)

cntr = boot(data="" statistic=cntr, R=5000)

BUT I get the following error:

Error in igraph.match.arg(mode) : 
  could not find function "igraph.match.arg"

John Erwin Bañez
Assistant Professor
College of Social Work and Community Development
University of the Philippines, Diliman

reply via email to

[Prev in Thread] Current Thread [Next in Thread]