cpness: Core-peripheriness measure

Description Usage Arguments Details Value Author(s) References Examples

View source: R/cpness.R

Description

Computation of the cpness measure for a bipartite graph/network

Usage

1
cpness(web, type=c("automatic","binary","integer","float"), plot=TRUE, fastplot=FALSE)

Arguments

web

A matrix with elements of a set (e.g., plants) as rows, elements of a second set (e.g., pollinators) as columns and number of interactions as entries. Species names can be indicated in the row or column names.

type

Type of matrix. This should be (an unambiguous abbreviation of) one of automatic (default), binary, integer or float. With automatic (default), the type of matrix is automatically deduced inside the function. Using binary, the matrix is binarized in any case. See the "Details" section.

plot

Plot the matrix reordered according to the core-periphery partitioning. TRUE by default.

fastplot

If TRUE, the matrix plot is performed using the fast image function instead of the visweb function from the bipartite package, without species names. Only for large matrices. FALSE by default.

Details

In a matrix displaying a core-periphery structure, there is a species ordering (i.e. an ordering in rows and columns) such that interactions are distributed in an L-shape. This L-shape is composed by four blocks of varying connectance: block C11 represents the core; blocks C12 and C21 include the interactions between core and periphery; block C22 includes the interactions that occur between peripheral species.

This fonction computes the core-peripheriness (CPness), as CPness=(E11+E12+E21)/E, where Eij is the number of interactions (edges) or the sum of weights for each block (Eij for block ij) or for the entire network (E). Here, we rely on a stochastic block model (SBM) to detect the four groups/blocks C11, C12, C21 and C22 when they actually exist. However, the SBM can fail in finding these blocks: in these cases, there is no core-periphery partition and the CPness value is set to NA.

This function can deal with binary and weighted networks with the appropriate statistical distribution (Bernouilli for binary data, Poisson for integer weights, and Gaussian for float weights). Note that it is often advisable to log-transform float data before running the cpness function.

Value

cpness returns an object of class list with the following components:

cpness

The value of the core-peripheriness measure. NA when no core-periphery partition is found.

rowmembership

An integer vector indicating the group to which species in rows are belonging. Group 1 is core and group 2 is periphery, unless there is only a single group.

colmembership

Same as rowmembership for species in columns.

Author(s)

Authors: Vincent Miele Maintainer: Vincent Miele <vincent.miele@univ-lyon1.fr>

References

Ana M. Martin Gonzalez, Diego P. Vazquez, Rodrigo Ramos-Jiliberto, Sang Hoon Lee & Vincent Miele, Core-periphery structure in mutualistic networks: an epitaph for nestedness? BiorXiv (2020) <doi:10.1101/2020.04.02.021691>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(bipartite)
data(mosquin1967)
result <- cpness(mosquin1967, type="automatic", plot=TRUE)
print(result)

data(junker2013)
result <- cpness(junker2013, type="automatic", plot=TRUE, fastplot=TRUE)
print(result$cpness)
print(table(result$rowmembership))
print(table(result$colmembership))

Example output

Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.5-7
Loading required package: sna
Loading required package: statnet.common

Attaching package:statnet.commonThe following object is masked frompackage:base:

    order

Loading required package: network
network: Classes for Relational Data
Version 1.16.1 created on 2020-10-06.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
                    Mark S. Handcock, University of California -- Los Angeles
                    David R. Hunter, Penn State University
                    Martina Morris, University of Washington
                    Skye Bender-deMoll, University of Washington
 For citation information, type citation("network").
 Type help("network-package") to get started.

sna: Tools for Social Network Analysis
Version 2.6 created on 2020-10-5.
copyright (c) 2005, Carter T. Butts, University of California-Irvine
 For citation information, type citation("sna").
 Type help(package="sna") to get started.

 This is bipartite 2.15.
 For latest changes see versionlog in ?"bipartite-package". For citation see: citation("bipartite").
 Have a nice time plotting and analysing two-mode networks.

Attaching package:bipartiteThe following object is masked frompackage:vegan:

    nullmodel

$cpness
[1] 0.9179104

$rowmembership
  Cerastium.alpinum    Caltha.palustris   Papaver.radicatum Potentilla.vahliana 
                  2                   2                   2                   1 
 Dryas.integrifolia         Geum.rossii  Astragalus.alpinus   Oxytropis.arctica 
                  1                   2                   1                   2 
 Petasites.frigidus       Arnica.alpina       Taraxacum.sp. 
                  2                   2                   2 

$colmembership
           Boloria.improba               Colias.hecla 
                         2                          1 
             Colias.nastes         Anarta.richardsoni 
                         2                          2 
           Rhamphomyia.sp.         Boreellus.atriceps 
                         2                          2 
       Protocalliphora.sp.        Spilogona.aesturium 
                         2                          2 
      Spilogona.almquistii          Spilogona.dorsata 
                         1                          2 
        Spilogona.hurdiana       Spilogona.latilamina 
                         2                          2 
      Spilogona.melanosoma         Spilogona.projecta 
                         2                          2 
     Spilogona.sanctipauli Eupogonomyia.probilofensis 
                         1                          1 
      Pogonomyiodes.segnis             Bombus.polaris 
                         2                          1 

[1] 0.7572879

 1  2 
 5 51 

  1   2 
  8 249 

econetwork documentation built on Oct. 18, 2021, 5:09 p.m.