The identification of compartments (i.e. clusters of overlapping species ranges across an environmental gradient) is an important methodological challenge for biogeographical studies. Recent developments in network theory offer promising perspectives on this issue using the measurement of modularity. A presence–absence matrix is modular if particular subgroups of species are mainly linked to particular subgroups of sites. Modularity is still rarely considered in biogeographical studies. Here, I compare different modularity indices to investigate which is the most appropriate for studying presence–absence matrices and similar types of networks, such as bipartite networks.