Skip to content

Removing from least- to most-connected in bipartite second.extinct?

1 message · Drew Tyre

#
Hi Scott,

I've not used package bipartite, but a quick look suggests it would be
easy to modify the extinction function to do what you want. in
extinction() simply replace max() in the following code with min(),
and it will go from least to most connected when method='degree'.

    if (meths.match == 3) {
        if (partis.match == 1) {
            sequ <- rowSums(web > 0)
            which.ex <- which(sequ == max(sequ))   ## change max to min
            if (length(which.ex) > 1)
                ex <- sample(which.ex, size = 1)
            else ex <- which.ex
            web[ex, ] <- 0
        }
        if (partis.match == 2) {
            sequ <- colSums(web > 0)
            which.ex <- which(sequ == max(sequ))  ## change max to min
            if (length(which.ex) > 1)
                ex <- sample(which.ex, size = 1)
            else ex <- which.ex
            web[, ex] <- 0
        }
    }

On Thu, Jul 12, 2012 at 11:24 PM, Scott Chamberlain
<myrmecocystus at gmail.com> wrote: