The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2...

15
The stability-diversity debate as related to plant-pollinator networks in the HJ Andrews Experimental Forest Emily Palmer Summer 2016 Abstract Studies about the relationship between diversity and stability have reached varying con- clusions. I used plant-pollinator interaction data sampled from meadows in the HJ Andrews to examine this relationship. I found a clear reciprocal relationship between the number of species in an interaction network and the connectance of the network, as theoretically expected. The number of plant and pollinator species in the meadows changed between the years of 2011-2015. Using two measures of compositional simi- larity, I determined that more complex networks, i.e. networks with more species and a higher connectance, tend to remain more similar between years in plant and polli- nator species composition, although plants show a clearer trend. This trend suggests that more complex networks are more stable. 1 Introduction The relationship between diversity and stability has been hotly debated throughout the ecological community. One side of the debate argues that in- creased complexity leads to decreased stability. This argument supposes that as a network becomes more connected, each member is more important, so the network is more vulnerable to the loss of any species. In this case a network that is more loosely connected would be more stable. Early theoretical ground- work by Robert May (1972) suggested that stability decreases with complex- ity. Using randomly connected models of food webs, May theorized that the networks would be stable if NC < 1 b where N is the number of species in the network, C is the connectance, and b is the interaction strength [5]. The interac- tion strength b is not feasible to measure in experimental studies. However know- ing the interaction strength not neces- sary for exploring the relationship, as the relationship implies that there will be a border between stable and unstable networks. Here I examine the dynamics of com- 1

Transcript of The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2...

Page 1: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

The stability-diversity debate as related toplant-pollinator networks in the HJ Andrews

Experimental Forest

Emily Palmer

Summer 2016

Abstract

Studies about the relationship between diversity and stability have reached varying con-clusions. I used plant-pollinator interaction data sampled from meadows in the HJAndrews to examine this relationship. I found a clear reciprocal relationship betweenthe number of species in an interaction network and the connectance of the network,as theoretically expected. The number of plant and pollinator species in the meadowschanged between the years of 2011-2015. Using two measures of compositional simi-larity, I determined that more complex networks, i.e. networks with more species anda higher connectance, tend to remain more similar between years in plant and polli-nator species composition, although plants show a clearer trend. This trend suggeststhat more complex networks are more stable.

1 Introduction

The relationship between diversityand stability has been hotly debatedthroughout the ecological community.One side of the debate argues that in-creased complexity leads to decreasedstability. This argument supposes thatas a network becomes more connected,each member is more important, so thenetwork is more vulnerable to the lossof any species. In this case a networkthat is more loosely connected would bemore stable. Early theoretical ground-work by Robert May (1972) suggested

that stability decreases with complex-ity. Using randomly connected modelsof food webs, May theorized that thenetworks would be stable if

√NC < 1

b

where N is the number of species in thenetwork, C is the connectance, and b isthe interaction strength [5]. The interac-tion strength b is not feasible to measurein experimental studies. However know-ing the interaction strength not neces-sary for exploring the relationship, asthe relationship implies that there willbe a border between stable and unstablenetworks.

Here I examine the dynamics of com-

1

Page 2: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

plexity, using√NC as a complexity in-

dex since it combines diversity with con-nectance. Complexity thus increases ifeither the number of species or the con-nectance of a network increases. Allesina(2012) built upon May’s model, relax-ing some of May’s simplistic assump-tions. Allesina adjusted for differenttypes of interactions, moving the cutoffpoint from < 1/b to another constantthat depends on an interaction strengthspecific to that network[1].

In all its mathematical beauty, May’sargument has been disputed vigorously.Other experimental work has shown thatdiversity is positively correlated withstability. This arguments supposes thatmore diverse networks have species thatare not as vital to the network. Therole of one species could be replacedby another species, so the network as awhole would not suffer from the loss ofone species, as higher diversity leads tofunctional redundancy. Studies such asTilman’s (2005) decade-long experimenton grasslands showed that increased di-versity of plant species led to greater sta-bility in production[7]. While each studyevaluates different measures in differenttypes of ecosystems, explaining differentcaveats to why the relationship wouldvary, there is not a consensus on the ef-fects of diversity on stability[2].

My study examines the relation-ship between complexity and stability inplant-pollinator interaction networks. Inthe meadows of the HJ Andrews, an in-teraction network is depicted as a ma-trix with plant species as columns andpollinator species as rows, and markedcells of a matrix where there would be aninteraction between one pollinator and

one plant. Figure 3 shows a hypotheti-cal example of an interaction matrix. Iuse May’s inequality as a null hypothesisover the other studies, because I love thetheoretical setup and pure mathematicalbeauty of his process.

Montane meadows provide a poten-tially useful study system to address thediversity/stability debate. The meadowsin the HJ Andrews Experimental Foresthave been sampled from 2011-2016, cre-ating a long term data set that includesmany types of changes throughout theyears. Meadow size has been decreas-ing[2], and the 2015 drought had manyeffects on the ecosystem. Disturbancessuch as the 2015 drought bring insightas to how networks respond to distur-bances that might start to become morecommon.

Taking into account all of the changesand distresses meadows face, I wonderedif certain meadows are more able to re-main stable. Stability in this paperis considered to be the level in whichspecies composition fluctuates[4]. Inthis paper, a stable network is one thatchanges less in species composition asmeasured by two different similarity in-dices. In some meadows, there is alarge variety of pollinator species, andin some only a few species of pollinatorwere caught. A more complex meadowis one with more species and more in-teractions. Thus complexity is mea-sured as both the number of speciesin the meadow and the connectance ofthe meadow’s plant-pollinator interac-tions. Previous studies of the relation-ship between diversity and stability havefocused on grasslands, food webs, etc.[5],[1],[7]. Plant-pollinator networks ex-

2

Page 3: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

hibit different properties of interactionsthan a food-web for example, and thusare interesting and new to examine inthis context.

Would meadows with a more com-plex plant-pollinator network be morestable, or less stable? In other words,

would meadows that have relatively fewflower species with a few pollinators bemore or less likely to change than mead-ows with many different flowers withvarying abundances and a multitude ofdifferent types of pollinators?

Definitions

Stability: Increased stability means lower levels of species composition fluctua-tion. A stable meadow is one that changes less, measured in this study by similarityindices

Complexity: A complex system would have more species, more interactions,and thus a more elaborate structure, Measured as a combination of richness andconnectance

Diversity/richness: The number of different species in a network; a networkwith more species would be more rich/diverse

Connectance: A measure of network structure, measured as the recorded numberof interactions divided by possible interactions. A higher connectance would meanproportionally more species were interacting

2 Methods

2.1 Data CollectionFigure 1: Interaction survey inprogress

This study used flower and interactionsurvey data from ten plots, five watches,and 9 meadows over the 2011-2015 sum-mer season in the HJ Andrews Exper-imental Forest. My analysis used datapoints aggregated at the watch level andthe year level. This produced a data setof 45 data points/yr × 5 years = 225data points used in watch level analy-sis and 9 data points/yr × 5 years = 45data points for the year level. Although

3

Page 4: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

there are currently 12 meadows beingsampled, I chose to only analyze mead-ows that were sampled for the entiretyof the study, leaving only 9. In eachwatch, flower surveys collected informa-tion about the abundance and speciesof flowers in the plot. Interaction sur-veys recorded the interaction of differentspecies of pollinators over fifteen non-consecutive minutes. An interaction wasrecorded if the insect landed on a repro-ductive structure of a flower in anthesis.

Figure 2: An example interaction ofBombus sp. on Gilia capitata

2.2 Data Analysis

This project used the R language to ana-lyze data from 2011-2015. In some years,certain meadows “dried-up” before sam-pling for the year was concluded. Mead-ows with no species at the watch-levelwere removed as connectance would beundefined.

Connectance is defined as the actualinterspecific interactions divided by to-tal possible interactions. A higher con-nectance means the interaction matrixhas more non-zero entries. In otherwords

C =L

Plant× Poll

where L is the sum of the filled cells inthe interaction matrix, and Plant × Pollis the number of total cells in the matrixas shown in Figure 3.

Complexity was measured by a com-bination of the number of species inthe network and the connectance ofthe plant-pollinator interaction network.Here I use May’s index of complexity toquantify complexity, defined as

√NC,

where N is the number of plant and polli-nator species and C is the connectance.A higher index of complexity means ahigh number of species that are highlyinterconnected with each other. Thenumber of species only takes into ac-count if a species is present, not the num-ber of interactions, so generalist polli-nator such as Apis mellifera would becounted the same way as a pollinatorthat has only one interaction occurrence.

Figure 3: An example interactionnetwork. Rows are different pollina-tor species, and columns are differentplant species. Filled in cells representwhich species were observed to inter-act. Diversity is defined for pollinatorsas the number of rows, and for plantsas the number of columns. Stability isthe change between consecutive yearsof which rows/columns are included, orhow the species composition changes.

4

Page 5: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

To analyze stability, or the fluctua-tion of species composition, the changesin species composition of plants and pol-linators were examined for each consec-utive year pair.

Two similarity coefficients were usedto quantify the change between con-secutive years in pollinator and plantspecies composition: the Jaccard coef-ficient and the Sørensen-Dice coefficient.These measures were chosen as they areintended for presence-absence data. TheSørensen-Dice takes into account thatthe presence of a species gives more in-formation than its absence, as absencecan be due to many factors.[3] Giventhat our interaction surveys can some-times miss insects, these measures werechosen.

The Jaccard coefficient is defined asthe length of the intersection divided bythe length of the union, or

J =|A ∪B||A ∩B|

where A and B are two sets, in our case,sets of species names. A higher Jaccardcoefficient would imply that the set ofspecies of pollinators was more similaracross years.

The Sørensen-Dice coefficient is de-fined as the twice the length of the inter-section divided by the sum of the lengthof both sets, or

S =2|A ∪B||A|+ |B|

3 Results

I found that the species richness of pol-linators has been changing throughout

the years of the study. Figure 4 showshow the number of species of pollinatorshas generally increased in 2013, but de-creased in the following years. For eachmeadow, there were fewer species of pol-linator in 2015 than 2011.

Figure 4: Pollinator species richnessover years

The species richness of plants fol-lowed a similar pattern to pollinators,although more meadows remained con-stant for the early years of the study asshown in Figure 5. Tukey’s test founda significant decrease in the number ofplant species from 2013-2015.

5

Page 6: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

Figure 5: Plant species richness overyears

Figure 6 illustrates the connectancefor each watch in each meadow in rela-tion to that network’s total number ofspecies. The relationship appears to bereciprocal. This relationship does notvary much throughout the years of thesample (Appendix 1). Sample pointscloser to the upper right of the graph, i.e.points above a best fit line, are pointswith relatively higher complexity. Thisrelationship is consistent with May’s ra-tionale, so I examine how the complexityvaries with changes in species composi-tion of the meadows. Since interactionstrength (b) was not measured, and isin fact extremely hard if not impossibleto measure in actual ecosystems, the 1/bcurve that May theorized would be thecutoff for instability cannot be graphed.Still, if May was right, we would imaginea spectrum of stability results forming anegative relationship with complexity. Ithen examine how the location of pointson this graph relates to the changes inspecies composition of those meadows.

Figure 6: Connectance (realizedlinks/possible links) vs number of plantand pollinator species of the interactionnetwork. Each data point representsone watch of one meadow in one year

The Jaccard Similarity Index wascomputed for sets of pollinator speciesin each meadow for each consecutivepair of years from 2011-2015. Figure 7shows the relationship between complex-ity and stability as measured by the Jac-card Similarity Index. Using linear re-gression, the slope was significantly dif-ferent from zero with a p value < 0.001.This indicates that as complexity of ameadow increases, the more similar inspecies composition that meadow is be-tween consecutive years. When I use thisrelationship to look at the Jaccard Sim-ilarity Index for plant species, I find italso exhibits a significant positive rela-tionship between complexity and stabil-ity, as shown in Figure 8. Plants exhibita stronger positive relationship (slope =0.145) than pollinators (slope = 0.075).

6

Page 7: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

Figure 7: Stability for pollinatorspecies vs Complexity Index (

√NC).

The linear regression shows a signifi-cant slope of 0.075, with r2 of 0.39

Figure 8: Stability for plant species vsComplexity Index (

√NC). The linear

regression shows a significant slope of0.145, with r2 of 0.17

The Sørensen-Dice coefficient wascomputed for each meadow for each pairof years as shown in the Appendix. A lin-ear regression was run, finding again that

complexity is positively correlated withthe Sørensen-Dice measure of similarity.Again the slope was significantly differ-ent from zero with p < 0.001. Again,plants exhibited a steeper slope, butlower r2 than pollinators. The Sørensen-Dice coefficient showed the same rela-tionship as the Jaccard Index, with aslightly steeper slope, and with a higher rsquared than the Jaccard Index for bothplant and pollinators.

4 Discussion and Con-

clusion

I found a strong relationship between thecomplexity of a meadow and its stabilityin both plant and pollinator species re-tention. This implies that more diversemeadows are more stable.

The total number of pollinatorspecies was variable throughout the timeperiod of the study, with decreases in2014-2015, likely due to drought. Seeingthese differences made me wonder whatcharacteristics these meadows have andhow they relate to the stability of themeadow. Having these changes in plantand pollinator species allows us to exam-ine stability with a variety of severity ofchanges.

According to May’s theory, onewould expect the reciprocal relation-ship that was found from plotting to-tal species richness against connectance.Theoretically there exists some curve1

Nb2that is a cutoff for stability. Net-

works below this curve would theoreti-cally be stable, and networks over thiscurve would be unstable. Since we don’thave this interaction strength value, we

7

Page 8: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

cannot plot this line.

Still, we would not expect networkswith a large number of species to havea high connectance due to the fact thatnot all of our observed insects are per-fect generalists. In addition, our sam-pling methods might be limited. Whenthere is an increased number of types ofpollinators, our chances of catching andidentifying each is reduced. This wouldlead to an observed relatively lower con-nectance. Still, it is interesting to notehow empty the upper right quadrant ofthe graph space is. Is this some effectof May’s theoretical invisible curve driv-ing networks into complete instability insuch that they could not exist? Or is itmore a factor of the types of specialist-s/generalists of the insects that pollinateeach meadow? Exploring exactly howgeneralist and specialist pollinators con-tribute to network structure as a wholewould be very interesting to examine.Regardless, this relationship is consis-tent with May’s rationale, so we examinehow the complexity varies with changesin species composition of the meadows.

Using both the Jaccard Index and theSørensen-Dice coefficient as measures ofstability, I found a significant positive re-lationship between the complexity andthe stability of meadows for both plantsand pollinators. This result conflictswith May’s prediction. Meadows thathad relatively higher complexity weremore likely to have a more similar com-position of pollinator species betweenyears. One could reason that as the com-plexity increased, there would be moreinterconnectedness, so a change or re-moval of a species would cause more dis-ruption for the network. However my re-

sults show this is not the case. In ourmeadows, my results suggest that morecomplex networks have more functionalredundancy. Therefore the loss of onespecies is not so significant. For bothstability measures, plants had a strongerrelationship between complexity and sta-bility than pollinators. This implies thatthe stability of plants is relatively moredependent on the network’s complexitythan pollinators.

One possible reason for the highertemporal variation with respect to com-plexity in plant diversity than insect di-versity may be purely methodological.Compared to plants, pollinators had ahigher number of species to begin with.In addition, Andy Moldenke identifiedthe species of pollinators each year ofthe survey. The method for catching theinsects has remained constant over theyears. However, plant species are identi-fied by new people each year, and somemisclassification has certainly occurred.This difference might have influenced thedifference in slopes.

The contrast between my results andMay’s (1972) is perhaps due to his as-sumptions of randomly connected foodwebs are unrealistic for plant-pollinatornetworks. Plant-pollinator networkshave a very specific interaction ma-trix structure caused by generalist andspecialist pollinator interactions. Eventhough Allesina (2012) expanded May’swork to account for different types of in-teraction networks by using an interac-tion strength that matched the type ofinteraction, (competitive, predator-prey,etc.), his results were consistent withMay’s.

I encourage future researchers to ex-

8

Page 9: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

amine how the stability/diversity rela-tionship holds at an ecosystem level, assome studies have shown that the di-versity/stability relationship is flipped atan ecosystem level[6]. I also encouragedifferent measures of stability, such asTilman’s measure of temporal stability,or by examining stability of plant andpollinator abundances[7].

The evolution of specialization andgeneralization in which insects visit cer-tain plants may lead to a more stablecommunity regardless of the complexity

index. My study does not consider in-teractions among plant species, such ascompetition for resources, or interactionsbetween pollinators, such as predation orcompetition. Adding these factors mightyield a different conclusion regarding thediversity-stability relationship. If the ad-dition of these factors still preserves thepositive relationship between diversityand stability, it demonstrates the im-portance of preserving complex meadowecosystems.

References

[1] Stefano Allesina and Si Tang. “Stability criteria for complex ecosystems”. In:Nature 483.7388 (2012), pp. 205–208.

[2] Steven A Highland. “The historic and contemporary ecology of western cascademeadows: archeology, vegetation, and macromoth ecology”. In: Masters thesis,Oregon State University (2011).

[3] Pierre Legendre, Louis Legendre, et al. Numerical ecology. Tech. rep. 1998.

[4] Robert M May et al. Theoretical ecology: principles and applications. Tech. rep.1981, pp. 219–225.

[5] Robert M May. “Will a large complex system be stable?” In: Nature 238 (1972),pp. 413–414.

[6] David Tilman. “Biodiversity: population versus ecosystem stability”. In: Ecology77.2 (1996), pp. 350–363.

[7] David Tilman, Peter B Reich, and Johannes MH Knops. “Biodiversity andecosystem stability in a decade-long grassland experiment”. In: Nature 441 (2006),pp. 629–632.

Appendix 1

9

Page 10: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

Figure 9: The relationship betweennumber of species and connectancedoes not change much between years

Figure 10: Sørensen-Dice Coeffi-cient for Pollinator Species. Both theSørensen-Dice and Jaccard Indices ex-hibit a positive relationship betweencomplexity and stability. Slope of 0.10and r2 of .39

Figure 11: Sørensen-Dice Coefficientfor Plant Species. Both the Sørensen-Dice and Jaccard Indices exhibit a pos-itive relationship between complexityand stability. Plants had a slightlyhigher slope compared to pollinatorswith slope of 0.15 and r2 of 0.17

R Code

#Import packages and func t i on sl ibrary ( igraph )l ibrary ( b i p a r t i t e )l ibrary ( ggp lot2 )l ibrary ( reshape )source ( ” bui ldIntMats2 . r ” ) #Rebecca ’ s code from f i r s t weeksource ( ” bui ldIntMats2015 .R” )source ( ”matsConn .R” )# Rebeccas code wi th changes to make matrix 1 s and 0 ssource ( ”matsConn2015 .R” )

#Remove a l l NA rowsNArowsToRemove = which( i s . na(bug$PLTSP NAME) | i s . na(bug$VISSP NAME) )bug2 = bug[−NArowsToRemove , ]NArowsToRemove = which( i s . na( bug2015$PLTSP NAME) | i s . na( bug2015$Vector .Name) )

10

Page 11: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

bug2015 = bug2015[−NArowsToRemove , ]

####################### Functions used ######################### Run my own connectance func t i on to a v i o i d n e two r k l e v e l s e r ror messagesconnectance = function (data ){

l = sum(data )Pl = ncol (data )Po = nrow(data )C = l / ( Pl ∗ Po)return (C)

}# Computes the Jaccard S im i l a r t y index f o r two s e t sj a cca rd Idx = function ( set1 , s e t2 ) {

return ( ( length ( intersect ( set1 , s e t2 ) ) /length (union ( set1 , s e t2 ) ) ) )}#Computes the sorensen−d i ce c o e f f i c i n t f o r two s e t sso r r enson = function ( set1 , s e t2 ) {

return ( (2∗length ( intersect ( set1 , s e t2 ) ) / ( length ( s e t1 )+length ( s e t2 ) ) ) )}

######################################################################## Loops run to c r ea t e s u b s e t s o f data and e x t r a c t i n f o from them ##########################################################################

###################### To f i nd n vs C#######################i n f o s = data . frame (row .names = c ( ” connectance ” , ” year ” , ”watch” , ”numberofspbugs” , ”numflow” , ”meado” , ”t o t a l s p e c i e s ” , ” s t a l k s ” ) )meadows = c ( ”CPB” , ”CPM” , ”CPR” , ”CPS” , ”LM” , ”LO” , ”M2” , ”RP1” , ”RP2” )m = 1j = 1y = 1w = 1while (m < length (meadows)+1){

while ( y < 5){while (w < 6){

flowermeadow = f l owe r [ which( f l owe r $MEADOW == meadows [m] & f l owe r $WATCH == w & f l owe r $YEAR == ( y +10)) , ]bugmeadow = bug [ which(bug$MEADOW == meadows [m] & bug$WATCH == w & bug$year == ( y +10)) , ]spb = length (unique (bugmeadow$VISSP NAME) )

11

Page 12: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

sp f = length (unique (bugmeadow$PLTSP NAME) )spt = spb + sp fs t a l k s = sum( flowermeadow$NO STALK, na .rm = TRUE)IMmeadow = bui ldIntMats2 (bugmeadow)conn = network l eve l (IMmeadow , index = ” connectance ” )mead = meadows [m]i n f o s [ , j ] = c ( conn , y+10,w, spb , spf , mead , spt , s t a l k s )j = j + 1w = w + 1

}w = 1y = y + 1

}y = 1m = m + 1

}# 2015m = 1w = 1while (m < length (meadows)+1){

while (w < 6){flowermeadow = f lower2015 [ which( f l ower2015$MEADOW == meadows [m] & f l ower2015$WATCH == w) , ]bugmeadow5 = bug2015 [ which( bug2015$MEADOW == meadows [m] & bug2015$WATCH == w) , ]sp f = length (unique (bugmeadow5$PLTSP NAME) )spb = length (unique (bugmeadow5$Vector .Name) )spt = sp f + spbIMmeadow15 = bui ldIntMats2015 (bugmeadow5)s t a l k s = sum( flowermeadow$NO STALK, na .rm = TRUE)netwVector = network l eve l ( IMmeadow15 , index = ” connectance ” )mead = meadows [m]i n f o s [ , j ] = c ( netwVector , 1 5 ,w, spb , spf , mead , spt , s t a l k s )j = j+1w = w + 1

}w = 1m = m + 1

}# transpose and put in format to be a b l e to e x t r a c t co l lumns by namet i n f o s = t ( i n f o s )t i n f o s = as . data . frame ( t i n f o s )t i n f ono0 = t i n f o s [−which( t i n f o s $connectance == 0 | t i n f o s $connectance == 1 ) , ]t i n f ono0$connectance = as . numeric ( as . vector ( t i n f ono0$connectance ) )

12

Page 13: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

t i n f ono0$ t o t a l s p e c i e s = as . numeric ( as . vector ( t i n f ono0$ t o t a l s p e c i e s ) )

################################### To f i nd S im i l a r i t y indeces ####################################ham = data . frame (row .names = c ( ”meadow” , ” conni ” , ” n s t o t a l ” , ” j a cP l ” , ” jacPo ” , ” yea rpa i r ” , ” s o r p l ” , ” sorpo ” ) )m = 1w = 1j = 1y = 11plantNames = levels (bug$PLTSP NAME)nPlants = length ( plantNames )pollNames = levels (bug$VISSP NAME)nPol l = length ( pollNames )while (y<14){

while (m < length (meadows)+1){by1 = bug [ which(bug$MEADOW == meadows [m] & bug$year == y ) , ]by2 = bug [ which(bug$MEADOW == meadows [m] & bug$year == y +1) , ]sp f = length (unique ( by1$PLTSP NAME) )spb = length (unique ( by2$VISSP NAME) )spt = sp f + spbIMy2 = matsConn ( by2 )IMy1 = matsConn ( by1 )Cy1 = connectance ( IMy1)plantNamesy1 = dimnames( IMy1 ) [ [ 1 ] ]p lantsy1 = array (0 , c ( nPlants , 1 ) )p lantsy1 [ i s . e lement ( plantNames , plantNamesy1 ) ] = 1plantNamesy2 = dimnames( IMy2 ) [ [ 1 ] ]p lantsy2 = array (0 , c ( nPlants , 1 ) )p lantsy2 [ i s . e lement ( plantNames , plantNamesy2 ) ] = 1j a c p l = jacca rd Idx ( plantNamesy1 , plantNamesy2 )pollNamesy1 = dimnames( IMy1 ) [ [ 1 ] ]po l l y1 = array (0 , c ( nPoll , 1 ) )po l l y1 [ i s . e lement ( pollNames , pollNamesy1 ) ] = 1pollNamesy2 = dimnames( IMy2 ) [ [ 1 ] ]po l l y2 = array (0 , c ( nPoll , 1 ) )po l l y2 [ i s . e lement ( pollNames , pollNamesy2 ) ] = 1jacpo = jaccard Idx ( pollNamesy1 , pollNamesy2 )s o r p l = sor renson ( plantNamesy1 , plantNamesy2 )sorpo = sor renson ( pollNamesy1 , pollNamesy2 )mead = meadows [m]ham[ , j ] = c (mead , Cy1 , spt , j a cp l , jacpo , paste ( as . character ( y ) , as . character ( y+1)) , so rp l , sorpo )

13

Page 14: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

j = j+1m = m + 1

}m = 1y = y + 1

}while (m < length (meadows)+1){

b15 = bug2015 [ which( bug2015$MEADOW == meadows [m] ) , ]b14 = bug [ which(bug$MEADOW == meadows [m] & bug$year == 1 4 ) , ]sp f = length (unique ( b14$PLTSP NAME) )spb = length (unique ( b14$VISSP NAME) )spt = sp f + spbIM15 = matsConn2015 ( b15 )IM14 = matsConn ( b14 )C14 = connectance ( IM14)plantNames14 = dimnames( IM14 ) [ [ 1 ] ]p lants14 = array (0 , c ( nPlants , 1 ) )p lants14 [ i s . e lement ( plantNames , plantNames14 ) ] = 1plantNames15 = dimnames( IM15 ) [ [ 1 ] ]p lants15 = array (0 , c ( nPlants , 1 ) )p lants15 [ i s . e lement ( plantNames , plantNames15 ) ] = 1pollNames14 = dimnames( IM14 ) [ [ 2 ] ]p o l l 1 4 = array (0 , c ( nPoll , 1 ) )p o l l 1 4 [ i s . e lement ( pollNames , pollNames14 ) ] = 1pollNames15 = dimnames( IM15 ) [ [ 2 ] ]p o l l 1 5 = array (0 , c ( nPoll , 1 ) )p o l l 1 5 [ i s . e lement ( pollNames , pollNames15 ) ] = 1j a c p l = jaccard Idx ( plantNames14 , plantNames15 )jacpo = jaccard Idx ( pollNames14 , pollNames15 )s o r p l = sor renson ( plantNames14 , plantNames15 )sorpo = sor renson ( pollNames14 , pollNames15 )mead = meadows [m]ham[ , j ] = c (mead , C14 , spt , j a cp l , jacpo , ”14 15” , so rp l , sorpo )j = j+1m = m + 1

}# transpose and put in format to be a b l e to e x t r a c t co l lumns by nametham = t (ham)tham = as . data . frame ( tham)tham$conni = as . numeric ( as . vector ( tham$conni ) )tham$ n s t o t a l = as . numeric ( as . vector ( tham$ n s t o t a l ) )tham$hamPl = as . numeric ( as . vector ( tham$hamPl ) )

14

Page 15: The stability-diversity debate as related to plant-pollinator ......Bombus sp. on Gilia capitata 2.2 Data Analysis This project used the R language to ana-lyze data from 2011-2015.

tham$ j a cP l = as . numeric ( as . vector ( tham$ j a cP l ) )tham$ jacPo = as . numeric ( as . vector ( tham$ jacPo ) )tham$ s o r p l = as . numeric ( as . vector ( tham$ s o r p l ) )tham$ sorpo = as . numeric ( as . vector ( tham$ sorpo ) )nc = (tham$ n s t o t a l∗tham$conni ) ˆ . 5gham = data . frame ( nc , tham$meadow , tham$hamPl , tham$conni , tham$hamPo , tham$ jacPl , tham$ jacPo , tham$yea rpa i r )

#### Example o f l i n e a r r e g r e s s i on runl r = lm( tham$ jacPo ˜ nc )summary( l r )

15