The goal: quantify the effect of functional similarity between species on the probability of co-occurrence. If the data contain a signal of competitive niche differentiation, then functionally dissimilar species pairs will be more likely to co-occur. ‘compnet’ uses hierarchical Bayesian network regression models to quantify this effect with presence-absence data and species-level trait data (e.g., plant leaf size) and/or pair-level trait data (e.g., phylogenetic distance). Various random effects structures are used to deal with the types of non-independence found in network data. First, follow the rstan installation instructions: (https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started). Then, in R, run install.packages(“devtools”), then devtools::install_github(“kyle-rosenblad/compnet”). Further information is available on the package website: https://kyle-rosenblad.github.io/compnet/index.html.