Description Usage Arguments Details Value Author(s) References Examples

This procedure calculates the pairwise diet overlap between all individuals in a sample.

1 | ```
overlap(dataset)
``` |

`dataset ` |
Object of class RInSp with data. |

For a sample size of N individuals, this will produce an N * N matrix, each cell *o_{ik}* representing the diet overlap between individual i and individual k. The diagonal is all ones because an individual has a 100% overlap with itself. Pairwise overlap is calculated by determining the proportional similarity between each individual.

The script reports the average pairwise diet overlap (not including diagonal values), the average pairwise diet dissimilarity (i.e., one minus the average pairwise diet overlap) and the complete diet overlap matrix. The overlap matrix can be useful for testing whether diet (dis)similarity is a function of various other metrics of between-individual difference or similarity (e.g., Bolnick and Paull 2009).

Return an matrix of three columns:

`meanoverlap` |
The mean pairwise overlap for all pairs of individuals, excluding the diagonal. |

`meanindividualoverlap` |
The mean pairwise overlap for individual i and all others, excluding the diagonal. |

`meandissimilarity` |
The mean pairwise dissimilarity overlap for all pairs of individuals, excluding the diagonal. |

`overlapmatrix` |
The probability associated to the likelihood value. |

`parameter=0` |
Internal option for plotting results. |

Dr. Nicola ZACCARELLI

Bolnick, D.I., and Paull, J.S., 2009. Morphological and dietary differences between individuals are weakly but positively correlated within a population of threespine Stickleback. *Evolutionary Ecology Research* **11**: 1217-1233.

Bolnick, D.I., L.H. Yang, J.A. Fordyce, J.M. Davis, and Svanback, R. 2002. Measuring individual-level resource specialization. *Ecology* **83**: 2936-2941.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
data(Stickleback)
# Select a single spatial sampling site (site D)
GutContents_SiteD = import.RInSp(Stickleback, row.names = 1,
info.cols = c(2:13), subset.rows = c("Site", "D"))
similarity = overlap(GutContents_SiteD)
## Not run:
# Generate a plot similar to Bolnick and Paull 2009, testing whether
# morphological differences between individuals are positively related
# to diet differences (or conversely are negatively related to diet similarity)
GutContents = import.RInSp(Stickleback, row.names = 1,info.cols = c(2:13))
similarity = overlap(GutContents)
diet.similarity = as.dist(similarity$overlapmatrix)
size.dissimilarity = dist(GutContents$info[,3])
plot(diet.similarity ~ size.dissimilarity, xlab = "Size dissimilarity",
ylab = "Diet similarity", pch = 16, cex = 0.4)
model = lm(diet.similarity ~ size.dissimilarity)
abline(model, lwd = 3, col = "red")
# The ade4 package is needed to complete the analysis
library(ade4)
mantel.rtest(diet.similarity, size.dissimilarity)
## End(Not run)
``` |

```
Warning!
The total number of sample was 126 but 4 individuals were dropped
as not consuming the selected resources
Warning!
The total number of resources was 39 but 8 resources were dropped
because not present in the selected sample
The mean pairwise overlap is 0.3083953
The mean pairwise dissimilarity is 0.6916047
Warning!
The total number of sample was 265 but 9 individuals were dropped
as not consuming the selected resources
The mean pairwise overlap is 0.2294365
The mean pairwise dissimilarity is 0.7705635
Monte-Carlo test
Call: mantelnoneuclid(m1 = m1, m2 = m2, nrepet = nrepet)
Observation: -0.092798
Based on 99 replicates
Simulated p-value: 1
Alternative hypothesis: greater
Std.Obs Expectation Variance
-3.9074876917 -0.0008223495 0.0005540520
Warning messages:
1: In is.euclid(m1) : Zero distance(s)
2: In is.euclid(m2) : Zero distance(s)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.