Professional Documents
Culture Documents
where p
ij
and p
kj
are the proportion of the resource j for the two
individuals. The diagonal in the diet overlap matrix is all ones
because an individual has a 100% overlap with itself, and it
can be used for testing whether diet (dis)similarity is a function
of various other metrics of between-individual dierence or
similarity (e.g. Bolnick & Paull 2009). The matrix of o
ik
values
is provided for subsequent analyses or to generate gures
showing network connectivity among individuals as in Ara ujo
et al. (2008).
The average pairwise overlap similarity is calculated as:
O
P
pairs
o
ij
0 5NN 1
The procedure Eindex provides the Eindex of individual spe-
cialization, a measure of the average pairwise dissimilarity, cal-
culated as E = 1O (Ara ujo et al. 2008). The index ranges
from0, when all individuals use the same resources in the same
proportions, to 1, when every individual relies entirely on a
dierent resource. Estimates of Emay be biased upwards when
there are few resource observations per individual. To account
for this bias we recommend calculating an adjusted E:
E
adj
E
obs
E
null
1 E
null
This procedure standardizes the observed value E
obs
between 0
(when the observed value is equal to the mean null value E
null
)
and 1 (when individual specialization is maximal) allowing the
comparison of data sets with dierent mean null values. A
jackknife estimation of the variance of E is derived based on
the estimation procedure provided by Ara ujo et al. (2008). In
addition, RInSp calculates the C
w
measure of the relative
degree of clustering in a network to test for modularity in the
niche overlap network (Ara ujo et al. 2008). Two dierent
weighted clustering coecients can be calculated. The degree
of unweighted clustering around a node i in a network is quan-
tied by evaluating the number of triangles in which the node
participates, normalized by the maximum possible number of
such triangles. By extension, a weighted clustering coecient
should take into account how much weight is present in the
neighbourhood of the node, compared with some reference
case. Barrat et al. (2004) proposed a weighted version of the
clustering coecient of the form:
C
wi
1
s
i
k
i
1
X
j;h
w
ij
w
ih
2
a
ij
a
ih
where s
i
is the sum of the weights (w
i
) of all the edges between
node i and the nodes to which it is connected; k
i
is the number
of edges between node i and its neighbours; w
ij
is the weight of
the edge between two nodes i and j; a is 1 if an edge is present
between each pair ij, ih and jh, respectively, and zero otherwise.
The sum, therefore, quanties the weights of all edges between
node i and its neighbours that are also neighbours to each
other. Saramaki et al. (2007) proposed an alternative
clustering index of the form:
C
wi
1
k
i
k
i
1
X
j;h
w
ij
w
ih
w
jh
1
3
where k
i
is the number of edges between individual i and its
neighbours; w
ij
is the weight of the edge between individual i
2013 The Authors. Methods in Ecology and Evolution 2013 British Ecological Society, Methods in Ecology and Evolution, 4, 10181023
Individual specialisation indices 1019
and j obtained by dividing the actual weight by the maximum
of all weights. The summation, therefore, quanties the
weights of all edges between individual i and its neighbours
that are also neighbours to each other.
The procedure Emc performs a Monte Carlo resampling to
derive a statistical test for both indices. For counts of individ-
ual prey items representing approximately independent prey
captures (i.e. integer data type), it is possible to run a Monte
Table 1. Asummary of the indices of individual specialization originally present in IndSpec1 and part of RInSp. Ashort description of their theoret-
ical background is provided along with relevant references. For further details, please refer to the package help pages
Index Description Implementation in RInSp
PS; IS Czekanowskis proportional similarity index (PS) is: PS
i
1 0 5
P
j
jp
ij
q
j
j
(Schoener 1968) where p
ij
is the frequency of category j in the individual is diet,
and q
j
is the frequency of category j in the population as a whole.
By the average of individuals PS
i
values, the prevalence of individual
specialization in the population is measured as: IS
P
i
PSi
N
The function PSicalc calculates individual
estimates of pairwise specialization, its
variance, and IS values, along with other
information regarding the population diet
used, and the total number of samples.
Hypothesis testing by Monte Carlo
resampling is available when all individuals
are kept to obtain distributions of PS
i
and IS.
In addition, the user has the option to
exclude the focal individual fromthe
calculation of the population diet.
k
i
; W
i
The likelihood ratio of the observed diet of individual i against the population
diet is: k
i
Q
j
qj
pij
nij
(Petraitis 1979) where q
j
is the population proportion of
the resource j, p
ij
is the proportion of the resource j in the diet of the individual
i and n
ij
is the number of items for the individual i and the resource j. k
i
is
sensitive to the sample size of the diet items of each individual (D
i
), and a
standardized measure is calculated as: W
i
k
1
D
i
i
For a complete generalist
individual, W
i
= 1, and the value decreases with greater specialization.
RInSp provides the function like.Wi
calculating on categorical diet data the value
of the mean W
i
for individual in the diet
matrix, along with the single W
i
, k
i
, and
associated probability values.
TNW, WIC,
BIC, WIC/
TNW
According to Roughgarden (1972), the total niche width of a population
(TNW) can be broken down into two components: the variation in resource use
within individuals (within-individual component, WIC), and the variance
between individuals (between-individual component, BIC). These measures can
be calculated as:
TNW Varx
ij
WIC BIC
WIC EVarx
j
ji
BIC VarEx
j
ji
Assuming a matrix Xof diet data, where each element x
ij
is the size (or other
measure) of the prey itemj in individual is diet.
With discrete, unordered resource categories, the Shannon information theory
formula is used (Roughgarden 1979, p, 528):
TNW
X
h
u X
h
ln u X
h
WIC
X
i
p Y
i
X
h
v X
h
jY
i
ln v X
h
jY
i
" #
BIC
X
i
p Y
i
ln p Y
i
" #
X
h
u X
h
X
i
q Y
i
jX
h
ln q Y
i
jX
h
" # ( )
where X
h
denotes a resource category, with h = 1,H, Y
i
denotes an individual,
with i = 1,S, P(X
h
|Y
i
) is a joint distribution function expressing the probability
that a resource is of type X
i
and is used by individual Y
i
, with
P
h
P
i
P X
h
; Y
i
1, p(Y
i
) represents the population individual distribution,
irrespective of their resource use, calculated as p Y
i
P
h
P X
h
; Y
i
, u(X
h
)
represents the whole population resource use, irrespective of what each individual
consumes, calculated as u X
h
P
i
P X
h
; Y
i
, v X
h
jY
i
P Xh;Yi
p Yi
is the
conditional distribution of resource use for each given individual, while
q Y
i
jX
h
P Xh;Yi
u Xh
is the distribution of individuals using any given resource.
For both continuous and discrete data, the relative degree of individual
specialization can be measured as the proportion of TNWexplained by within-
individual variation, or WIC/TNW.
The procedures WTcMC and WTdMCperform
the analysis of Roughgarden indices in the
continuous and discrete case, respectively.
AMonte Carlo resampling approach is used
to evaluate the statistical relevance against a
null hypothesis. The null model corresponds
to a population composed of generalists that
sample randomly fromthe populations diet
and have diet sizes equal to those of the
observed data set.
2013 The Authors. Methods in Ecology and Evolution 2013 British Ecological Society, Methods in Ecology and Evolution, 4, 10181023
1020 N. Zaccarelli, D. I. Bolnick & G. Mancinelli
Carlo resampling simulation to test the null hypothesis that
any observed diet variation arose from individuals sampling
stochastically from a shared distribution (Ara ujo, Bolnick &
Layman 2011). Both E and C
w
values are recalculated for the
resulting simulated population. A user-specied number of
null data sets is generated, and the observed test statistic is
compared with the distribution observed under the null
hypothesis. Two options are oered for calculating the popula-
tions diet proportions (q
j
, the proportion of the resource j in
the populations diet): sum and average. When sum is spec-
ied, all resource counts are summed within a category across
all individuals to get the populations use, then the proportion
of each resource category in the populations repertoire is
determined as:
q
j
P
i
n
ij
P
ij
n
ij
The drawback of this approach is that individuals that eat
large numbers of items, or larger total mass of items, will bias
the population to look more like them (Bolnick et al. 2003).
The average method circumvents this problem by rst con-
verting individual diets into proportions p
ik
, then averaging
these proportions for each resource k, thereby giving all
individuals equal inuence over the estimated population
diet.
NODF A NESTEDNESS MEASURE
For studies of individual specialization, one form of diet vari-
ation arises when individuals dier in their niche breadth,
such that some individuals diet is a subset of other individu-
als diets. This is revealed by a nestedness metric, which in
RInSp can be estimated for a binary matrix using the func-
tion NODF. The procedure is based on two principles: decreas-
ing ll (or DF) and paired overlap (or PO). In a matrix with
m rows and n columns, row i is located at an upper position
from row j, and column k is located at a left position from
column l. In addition, let MT be the marginal total (i.e. the
sum of 1s) of any column or row. For any pair of rows/col-
umns i and j, DF
ij
will be equal to 100 if MT
j
is lower than
MT
i
. Alternatively, DF
ij
will be equal to 0 if MT
j
is greater or
equal to MT
i
. For columns/rows, PO
kl
is simply the percent-
age of 1s in a given column/row l that are located at identical
row/column positions to those in a column/row k. For any
left-to-right column pair and, similarly, for any up-to-down
row pair, there is a degree of paired nestedness (N
paired
) as
zero if DF
paired
is zero, and PO if DF
paired
is 100. From the n
(n1)/2 and m(m1)/2 paired degrees of nestedness for n col-
umns and m rows, a measure of nestedness among all col-
umns (N
col
) and among all rows (N
row
) can be calculated by
simply averaging all paired values of columns and rows.
Thus, a measure of nestedness for the whole matrix is given
by (Almeida-Neto et al. 2008):
0%
5%
10%
15%
20%
25%
40% 45% 50% 55% 60% 65% 70% 75% 80%
D
i
s
c
r
e
p
a
n
c
y
m m1
2
RInSp utilities andexample data sets
In the online supporting information, a description of the utili-
ties included in the package for further analyses and data
exchange is provided. In addition, RInSp includes two exam-
ples of freshwater sh diets, one for categorical and one for
continuous raw data matrices. The Stickleback example
reproduces data fromBolnick &Paull (2009) of counts of prey
categories in stomach contents of individuals from a popula-
tion of three-spine sticklebacks (Gasterosteus aculeatus), using
265 specimens sampled fromve sites located in Roberts Lake
on Vancouver Island, British Columbia. The Trout example
reproduces data published in Kahilainen & Lehtonen (2001)
on sh prey lengths of a sample of 59 individuals of stocked (S)
and native (N) brown trout (Salmo trutta) from the subarctic
Lake Muddusjarvi in Northern Finland. Detailed examples of
application of RInSp indices using both data sets are provided
in the supporting information.
Future implementations of RInSp
The rst, stable release of RInSp is available on CRAN at
http://cran.rproject.org/web/packages/RInSp/index.html and
on GitHub at https://github.com/Nicola-Zaccarelli/RInSp. A
limitation on current metrics of individual specialization is the
eect of prey size in stomach content data. When prey is of
vastly unequal sizes, Monte Carlo resampling methods may
generate unrealistic null prey distributions. Future RInSp ver-
sions will implement size corrections that use diet data together
with a matrix of prey sizes and a vector of forager sizes, to esti-
mate maximum stomach volume and generate Monte Carlo
diets that are constrained to remain within realistic limits of
stomach volume.
Major eorts, however, will be made to generalize the
functions implemented in RInSp for the analysis of continu-
ous data. Specically, the WIC/TNW ratio partitions the
variance in individual resource use assuming a two-level,
intra- and interindividual hierarchy. In principle, it is possi-
ble to implement a hierarchical variance partition at n levels
of ecological organization, with n > 2. Recently, Violle et al.
(2012) have emphasized the need of a multi-level quantitative
scrutiny of trait variance in natural communities, proposing
a procedure of hierarchical variance partition of traits across
ecological levels of organization from individuals to com-
munity based on F-statistics (Wright 1949). The implemen-
tation of RInSp to calculate n-level hierarchical variance
components on both discrete and continuous data is straight-
forward and will represent a major improvement in the
power of the package to highlight changes across dierent
levels of ecological organization in individual diet specializa-
tion and, in general, individual traits ranging from leaf area
in plants to movement tortuosity in animals (e.g. Cornwell &
Ackerly 2009; Mancinelli 2010; Potenza & Mancinelli 2010).
The package includes the function Hier2L as a purely intro-
ductory illustration of these forthcoming features. The func-
tion decomposes the variance for continuous data based on
a user-specied factor. For example, the analysis of the Finn-
ish stocked and native trout data run separately provides a
WIC/TNW ratio of 3976% and 5896%, respectively (no
weighting procedure adopted). By considering both groups
as belonging to a single population, it is possible to fraction-
ate the total variance in prey lengths, that is, 96341, in com-
ponents estimating (i) the contribution of between-group (i.e.
native vs. stocked: BGC hereafter) variability equal to 2242,
corresponding to a BGC/TNW of 233% and (ii) the within-
individual contribution WIC = 47522, corresponding to an
overall WIC/TNW ratio of 4933%. Upcoming implementa-
tions will integrate the features currently included in RInSp
bootstrapping, correction for unequal samples in a gener-
alized n-level hierarchical variance partition procedure, mak-
ing the package prospectively useful for multi-scale trait
analysis in community studies.
Acknowledgements
Funding by FUR 20102011 to G. M. is acknowledged; D. I. B. was sup-
ported by the David and Lucille Packard Foundation and the Howard
Hughes Medical Institute. Thanks to Travis Ingram for providing the code
and solution to the weighting scheme option in Roughgardens indices calcu-
lation, and to Richard Svanback and an anonymous reviewer for constructive
comments that greatly improved the manuscript. This study is dedicated to
Lorenzo and Alice Zaccarelli, and to Soa Mancinelli, thy eternal summer
shall not fade.
References
Almeida-Neto, M., Guimar~aes, P., Guimar~aes, P.R., Loyola, R.D. & Ulrich, W.
(2008) Aconsistent metric for nestedness analysis in ecological systems: recon-
ciling concept andmeasurement. Oikos, 117, 12271239.
Ara ujo, M.S., Bolnick, D.I. &Layman, C.A. (2011) The ecological causes of indi-
vidual specialisation. Ecology Letters, 14, 948958.
Araujo, M.S., Bolnick, D.I., Machado, G., Giaretta, A.A. & dos Reis, S.F.
(2007) Using d
13
C stable isotopes to quantify individual-level diet variation.
Oecologia, 152, 643654.
Ara ujo, M.S., Guimara