abundance_change: Species Abundance Changes

Description Usage Arguments Value References Examples

View source: R/abundance_change.R

Description

Calculates the abundance change for species in a replicate between two time points. Changes are on abundance values provided, if relative data is used, then changes in relative abundance will be calculated.

Usage

1
2
3
4
5
6
7
8
abundance_change(
  df,
  time.var,
  species.var,
  abundance.var,
  replicate.var = NULL,
  reference.time = NULL
)

Arguments

df

A data frame containing time, species, and abundance columns and an optional columns of replicates.

time.var

The name of the time column.

species.var

The name of the species column.

abundance.var

The name of the abundance column.

replicate.var

The name of the optional replicate column. If specified, replicate must be unique within the dataset and cannot be nested within treatments or blocks.

reference.time

The name of the optional time point that all other time points should be compared to (e.g. the first year of data). If not specified, each comparison is between consecutive time points (the first and second year, second and third year, etc.)

Value

The abundance_change function returns a data frame with a subset of the following columns:

References

Avolio et al. Submitted

Examples

 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(pplots)
# Without replicates
df <- subset(pplots, plot == 25)
abundance_change(df = df,
                 species.var = "species",
                 abundance.var = "relative_cover",
                 time.var = "year")

# With replicates
df <- subset(pplots, year < 2004 & plot %in% c(6, 25, 32))
abundance_change(df = df,
                 species.var = "species",
                 abundance.var = "relative_cover",
                 replicate.var = "plot",
                 time.var = "year")
                 
# With reference year
df <- subset(pplots, year < 2005 & plot %in% c(6, 25, 32))
abundance_change(df = df,
                 species.var = "species",
                 abundance.var = "relative_cover",
                 replicate.var = "plot",
                 time.var = "year",
                 reference.time = 2002)

Example output

    year year2                    species       change
2   2002  2003          amorpha canescens -0.002123142
23  2002  2003        andropogon gerardii -0.082504430
28  2003  2004        andropogon gerardii  0.207558855
29  2004  2005        andropogon gerardii -0.304927630
34  2004  2005       andropogon scoparius  0.078196997
44  2002  2003       andropogon scoparius  0.062022085
45  2003  2004       andropogon scoparius -0.126299880
50  2003  2004        antennaria neglecta  0.002114165
55  2004  2005        antennaria neglecta -0.000948664
66  2002  2003            aster ericoides -0.007643615
71  2003  2004            aster ericoides  0.018097734
76  2004  2005            aster ericoides -0.010082940
87  2002  2003     bouteloua curtipendula -0.015529356
92  2003  2004     bouteloua curtipendula  0.006982922
93  2004  2005     bouteloua curtipendula  0.017618041
98  2004  2005           carex heliophila  0.025044723
108 2002  2003           carex heliophila -0.004928777
109 2003  2004           carex heliophila  0.013349527
114 2003  2004               carex meadii  0.001232635
119 2004  2005               carex meadii  0.064671763
125 2002  2003               carex meadii -0.016166450
135 2003  2004          conyza canadensis  0.002114165
140 2004  2005          conyza canadensis -0.002114165
157 2004  2005          cyperus lupulinus  0.002331002
162 2004  2005              dalea candida  0.001816013
172 2002  2003              dalea candida  0.022140908
173 2003  2004              dalea candida -0.022167840
178 2003  2004             dalea purpurea  0.004916978
183 2004  2005             dalea purpurea -0.006342495
189 2002  2003             dalea purpurea  0.001425517
194 2002  2003 dichanthelium oligosanthes -0.007734412
199 2003  2004 dichanthelium oligosanthes -0.002899254
204 2004  2005 dichanthelium oligosanthes  0.000433675
210 2002  2003     eragrostis spectabilis  0.010008882
215 2003  2004     eragrostis spectabilis -0.007912672
220 2004  2005     eragrostis spectabilis  0.025126036
231 2002  2003        koeleria pyramidata -0.006369427
242 2004  2005       kuhnia eupatorioides -0.002412317
252 2002  2003       kuhnia eupatorioides  0.003609190
253 2003  2004       kuhnia eupatorioides  0.000592208
258 2003  2004             linum sulcatum  0.012684989
263 2004  2005             linum sulcatum -0.012684989
269 2002  2003             linum sulcatum -0.004246285
274 2002  2003            physalis pumila -0.001395252
279 2003  2004            physalis pumila -0.000736868
284 2004  2005            physalis pumila -0.000948664
300 2003  2004       plantago rhodosperma  0.002114165
301 2004  2005       plantago rhodosperma -0.002114165
316 2002  2003              poa pratensis -0.084925690
322 2003  2004            ruellia humilis  0.002114165
327 2004  2005            ruellia humilis -0.002114165
338 2002  2003         senecio plattensis -0.002123142
364 2003  2004     sisyrinchium campestre  0.002114165
365 2004  2005     sisyrinchium campestre  0.000216837
370 2004  2005     solidago missouriensis  0.040467285
380 2002  2003     solidago missouriensis  0.002365268
381 2003  2004     solidago missouriensis  0.008070896
386 2003  2004         sorghastrum nutans -0.122615537
391 2004  2005         sorghastrum nutans  0.088767822
397 2002  2003         sorghastrum nutans  0.132692607
402 2002  2003          viola rafinesquii  0.001425517
407 2003  2004          viola rafinesquii -0.001425517
   year year2 plot                    species       change
1  2002  2003    6      ambrosia psilostachya  0.001881712
2  2002  2003    6        andropogon gerardii -0.038493392
3  2002  2003    6       andropogon scoparius -0.062873948
4  2002  2003    6      asclepias stenophylla  0.002890173
5  2002  2003    6     asclepias verticillata -0.002453548
6  2002  2003    6            aster ericoides  0.001777485
7  2002  2003    6     bouteloua curtipendula  0.058775310
8  2002  2003    6           carex heliophila -0.035087719
9  2002  2003    6               carex meadii  0.000873249
10 2002  2003    6              dalea candida  0.014315655
11 2002  2003    6             dalea purpurea  0.001445087
12 2002  2003    6 dichanthelium oligosanthes  0.011960699
13 2002  2003    6              draba reptans -0.001949318
14 2002  2003    6        koeleria pyramidata -0.002084530
15 2002  2003    6       kuhnia eupatorioides  0.026380579
16 2002  2003    6             linum sulcatum -0.009746589
17 2002  2003    6              poa pratensis  0.001746498
18 2002  2003    6       ratibida columnifera -0.003898635
19 2002  2003    6            ruellia humilis -0.002453548
20 2002  2003    6         senecio plattensis -0.002453548
21 2002  2003    6     sisyrinchium campestre -0.001949318
22 2002  2003    6     solidago missouriensis -0.003898635
23 2002  2003    6         sorghastrum nutans  0.053363982
24 2002  2003    6           sporobolus asper -0.006118379
25 2002  2003    6       triodanis perfoliata -0.001949318
26 2002  2003   25          amorpha canescens -0.002123142
27 2002  2003   25        andropogon gerardii -0.082504430
28 2002  2003   25       andropogon scoparius  0.062022085
29 2002  2003   25            aster ericoides -0.007643615
30 2002  2003   25     bouteloua curtipendula -0.015529356
31 2002  2003   25           carex heliophila -0.004928777
32 2002  2003   25               carex meadii -0.016166450
33 2002  2003   25              dalea candida  0.022140908
34 2002  2003   25             dalea purpurea  0.001425517
35 2002  2003   25 dichanthelium oligosanthes -0.007734412
36 2002  2003   25     eragrostis spectabilis  0.010008882
37 2002  2003   25        koeleria pyramidata -0.006369427
38 2002  2003   25       kuhnia eupatorioides  0.003609190
39 2002  2003   25             linum sulcatum -0.004246285
40 2002  2003   25            physalis pumila -0.001395252
41 2002  2003   25              poa pratensis -0.084925690
42 2002  2003   25         senecio plattensis -0.002123142
43 2002  2003   25     solidago missouriensis  0.002365268
44 2002  2003   25         sorghastrum nutans  0.132692607
45 2002  2003   25          viola rafinesquii  0.001425517
46 2002  2003   32      ambrosia psilostachya -0.000977422
47 2002  2003   32          amorpha canescens  0.005434900
48 2002  2003   32        andropogon gerardii  0.343172004
49 2002  2003   32       andropogon scoparius -0.181922336
50 2002  2003   32        antennaria neglecta -0.002534854
51 2002  2003   32         asclepias tuberosa  0.011299435
52 2002  2003   32            aster ericoides -0.024510752
53 2002  2003   32        aster oblongifolius  0.015065913
54 2002  2003   32     bouteloua curtipendula -0.076224642
55 2002  2003   32           carex heliophila  0.003118444
56 2002  2003   32               carex meadii  0.040926439
57 2002  2003   32       delphinium virescens  0.003766478
58 2002  2003   32   dichanthelium acuminatum -0.006337136
59 2002  2003   32 dichanthelium oligosanthes  0.011664626
60 2002  2003   32     eragrostis spectabilis -0.003802281
61 2002  2003   32          euphorbia serpens  0.001883239
62 2002  2003   32       kuhnia eupatorioides  0.003079060
63 2002  2003   32             linum sulcatum -0.003802281
64 2002  2003   32          panicum capillare  0.005649718
65 2002  2003   32              poa pratensis -0.008291980
66 2002  2003   32            ruellia humilis  0.001811633
67 2002  2003   32         senecio plattensis  0.000615812
68 2002  2003   32     solidago missouriensis  0.001450023
69 2002  2003   32         sorghastrum nutans -0.130867221
70 2002  2003   32           sporobolus asper -0.009666817
    year year2 plot                    species       change
1   2002  2003    6      ambrosia psilostachya  0.001881712
2   2002  2004    6      ambrosia psilostachya  0.002812774
3   2002  2003    6        andropogon gerardii -0.038493392
4   2002  2004    6        andropogon gerardii -0.161054202
5   2002  2003    6       andropogon scoparius -0.062873948
6   2002  2004    6       andropogon scoparius  0.131873308
7   2002  2004    6      asclepias stenophylla  0.001677852
8   2002  2003    6      asclepias stenophylla  0.002890173
9   2002  2004    6     asclepias verticillata -0.002220783
10  2002  2003    6     asclepias verticillata -0.002453548
11  2002  2003    6            aster ericoides  0.001777485
12  2002  2004    6            aster ericoides -0.019345998
13  2002  2003    6     bouteloua curtipendula  0.058775310
14  2002  2004    6     bouteloua curtipendula -0.040935673
15  2002  2004    6           carex heliophila  0.011892147
16  2002  2003    6           carex heliophila -0.035087719
17  2002  2004    6               carex meadii  0.007303400
18  2002  2003    6               carex meadii  0.000873249
20  2002  2004    6          conyza canadensis  0.005033557
21  2002  2003    6              dalea candida  0.014315655
22  2002  2004    6              dalea candida  0.005082617
24  2002  2003    6             dalea purpurea  0.001445087
25  2002  2004    6 dichanthelium oligosanthes  0.021736856
26  2002  2003    6 dichanthelium oligosanthes  0.011960699
27  2002  2003    6              draba reptans -0.001949318
28  2002  2004    6              draba reptans -0.001949318
30  2002  2004    6         erigeron strigosus  0.001677852
31  2002  2003    6        koeleria pyramidata -0.002084530
32  2002  2004    6        koeleria pyramidata  0.029978937
33  2002  2004    6       kuhnia eupatorioides -0.009746589
34  2002  2003    6       kuhnia eupatorioides  0.026380579
35  2002  2004    6             linum sulcatum  0.010387639
36  2002  2003    6             linum sulcatum -0.009746589
37  2002  2003    6              poa pratensis  0.001746498
38  2002  2004    6              poa pratensis -0.007205280
39  2002  2003    6       ratibida columnifera -0.003898635
40  2002  2004    6       ratibida columnifera -0.003898635
41  2002  2004    6            ruellia humilis  0.002812774
42  2002  2003    6            ruellia humilis -0.002453548
43  2002  2004    6         senecio plattensis -0.003898635
44  2002  2003    6         senecio plattensis -0.002453548
46  2002  2004    6          silene antirrhina  0.010067114
47  2002  2003    6     sisyrinchium campestre -0.001949318
48  2002  2004    6     sisyrinchium campestre -0.001949318
49  2002  2004    6     solidago missouriensis  0.012879888
50  2002  2003    6     solidago missouriensis -0.003898635
51  2002  2004    6         sorghastrum nutans  0.004686867
52  2002  2003    6         sorghastrum nutans  0.053363982
53  2002  2003    6           sporobolus asper -0.006118379
54  2002  2004    6           sporobolus asper -0.020850504
55  2002  2003    6       triodanis perfoliata -0.001949318
56  2002  2004    6       triodanis perfoliata  0.009795648
58  2002  2004    6          viola rafinesquii  0.003355705
59  2002  2003   25          amorpha canescens -0.002123142
60  2002  2004   25          amorpha canescens -0.002123142
61  2002  2003   25        andropogon gerardii -0.082504430
62  2002  2004   25        andropogon gerardii  0.125054425
63  2002  2003   25       andropogon scoparius  0.062022085
64  2002  2004   25       andropogon scoparius -0.064277795
66  2002  2004   25        antennaria neglecta  0.002114165
67  2002  2003   25            aster ericoides -0.007643615
68  2002  2004   25            aster ericoides  0.010454119
69  2002  2003   25     bouteloua curtipendula -0.015529356
70  2002  2004   25     bouteloua curtipendula -0.008546434
71  2002  2003   25           carex heliophila -0.004928777
72  2002  2004   25           carex heliophila  0.008420750
73  2002  2003   25               carex meadii -0.016166450
74  2002  2004   25               carex meadii -0.014933815
76  2002  2004   25          conyza canadensis  0.002114165
77  2002  2003   25              dalea candida  0.022140908
78  2002  2004   25              dalea candida -0.000026932
79  2002  2003   25             dalea purpurea  0.001425517
80  2002  2004   25             dalea purpurea  0.006342495
81  2002  2003   25 dichanthelium oligosanthes -0.007734412
82  2002  2004   25 dichanthelium oligosanthes -0.010633666
83  2002  2004   25     eragrostis spectabilis  0.002096210
84  2002  2003   25     eragrostis spectabilis  0.010008882
85  2002  2003   25        koeleria pyramidata -0.006369427
86  2002  2004   25        koeleria pyramidata -0.006369427
87  2002  2003   25       kuhnia eupatorioides  0.003609190
88  2002  2004   25       kuhnia eupatorioides  0.004201398
89  2002  2003   25             linum sulcatum -0.004246285
90  2002  2004   25             linum sulcatum  0.008438704
91  2002  2003   25            physalis pumila -0.001395252
92  2002  2004   25            physalis pumila -0.002132120
94  2002  2004   25       plantago rhodosperma  0.002114165
95  2002  2003   25              poa pratensis -0.084925690
96  2002  2004   25              poa pratensis -0.084925690
98  2002  2004   25            ruellia humilis  0.002114165
99  2002  2003   25         senecio plattensis -0.002123142
100 2002  2004   25         senecio plattensis -0.002123142
102 2002  2004   25     sisyrinchium campestre  0.002114165
103 2002  2003   25     solidago missouriensis  0.002365268
104 2002  2004   25     solidago missouriensis  0.010436164
105 2002  2003   25         sorghastrum nutans  0.132692607
106 2002  2004   25         sorghastrum nutans  0.010077070
107 2002  2003   25          viola rafinesquii  0.001425517
109 2002  2003   32      ambrosia psilostachya -0.000977422
110 2002  2004   32      ambrosia psilostachya -0.003802281
111 2002  2003   32          amorpha canescens  0.005434900
112 2002  2004   32          amorpha canescens -0.019792540
113 2002  2004   32        andropogon gerardii  0.019892096
114 2002  2003   32        andropogon gerardii  0.343172004
115 2002  2004   32       andropogon scoparius -0.072216543
116 2002  2003   32       andropogon scoparius -0.181922336
117 2002  2004   32        antennaria neglecta -0.002534854
118 2002  2003   32        antennaria neglecta -0.002534854
119 2002  2003   32         asclepias tuberosa  0.011299435
121 2002  2004   32            aster ericoides -0.004753809
122 2002  2003   32            aster ericoides -0.024510752
123 2002  2004   32        aster oblongifolius  0.012084592
124 2002  2003   32        aster oblongifolius  0.015065913
125 2002  2004   32     bouteloua curtipendula -0.078440720
126 2002  2003   32     bouteloua curtipendula -0.076224642
127 2002  2003   32           carex heliophila  0.003118444
128 2002  2004   32           carex heliophila -0.015850497
129 2002  2004   32               carex meadii  0.053739293
130 2002  2003   32               carex meadii  0.040926439
131 2002  2004   32          conyza canadensis  0.004531722
134 2002  2003   32       delphinium virescens  0.003766478
135 2002  2003   32   dichanthelium acuminatum -0.006337136
136 2002  2004   32   dichanthelium acuminatum  0.005747456
137 2002  2003   32 dichanthelium oligosanthes  0.011664626
138 2002  2004   32 dichanthelium oligosanthes  0.034050138
139 2002  2004   32     eragrostis spectabilis -0.003802281
140 2002  2003   32     eragrostis spectabilis -0.003802281
142 2002  2003   32          euphorbia serpens  0.001883239
143 2002  2004   32       kuhnia eupatorioides  0.007258030
144 2002  2003   32       kuhnia eupatorioides  0.003079060
145 2002  2003   32             linum sulcatum -0.003802281
146 2002  2004   32             linum sulcatum -0.003802281
148 2002  2003   32          panicum capillare  0.005649718
149 2002  2004   32              poa pratensis  0.005695764
150 2002  2003   32              poa pratensis -0.008291980
151 2002  2004   32            ruellia humilis -0.007604563
152 2002  2003   32            ruellia humilis  0.001811633
153 2002  2003   32         senecio plattensis  0.000615812
154 2002  2004   32         senecio plattensis -0.001267427
155 2002  2004   32     solidago missouriensis -0.000589679
156 2002  2003   32     solidago missouriensis  0.001450023
157 2002  2004   32         sorghastrum nutans  0.069373447
158 2002  2003   32         sorghastrum nutans -0.130867221
159 2002  2004   32           sporobolus asper -0.020573674
160 2002  2003   32           sporobolus asper -0.009666817
162 2002  2004   32       triodanis perfoliata  0.006042296
164 2002  2004   32          viola rafinesquii  0.016616314

codyn documentation built on Dec. 1, 2020, 9:09 a.m.