-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathFF_tables.Rmd
More file actions
199 lines (180 loc) · 7.89 KB
/
Copy pathFF_tables.Rmd
File metadata and controls
199 lines (180 loc) · 7.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
---
output: pdf_document
header-includes:
\usepackage{longtable}\setlength{\LTleft}{0em}
fontsize: 8pt
---
```{r setup, include=FALSE, echo=F, message=F, warning=F}
knitr::opts_chunk$set(echo = FALSE,message=F, warning=F)
library(knitr)
library(dplyr)
library(stargazer)
```
**7. Tables**
Table 1. Variables Used in PERMANOVA Models.
|Variable |Abbreviation| Source |
|:----------------------------|---:|--------:|
|**Fire** || |
|Time Since Fire |TSF | MTBS|
|Fire Frequency |FF | MTBS|
||||
|**Climate** | | |
|Maximum Vapor Pressure Deficit| | |
|*Year of Fire* |vpdmax_during | GRIDMET|
|*Year before Fire* |vpdmax_before | GRIDMET|
|*Year after Fire* |vpdmax_after | GRIDMET|
|Maximum Temperature | | |
|*Year of Fire* |tmax_during | GRIDMET|
|*Year before Fire* |tmax_pre | GRIDMET|
|*Year after Fire* |tmax_after | GRIDMET|
|Precipitation | | |
|*Nov - May; 2 Years Before Fire* |ppt_2pre | GRIDMET|
|*Nov - May; 1 Year Before Fire* |ppt_1pre | GRIDMET|
|*Nov - May; After Fire* |ppt_post | GRIDMET|
| | | |
|**Other**|||
|Folded Aspect | | Field Measurements|
|Slope | | Field Measurements|
|Elevation || USGS |
|Animal Unit Months per Hectare |AUM_ha | BLM |
\clearpage
\newpage
<!-- # ```{r, results='asis'} -->
<!-- # commented out due to one asinine glitch in the table generation that I could -->
<!-- # not figure out. Something caused by Rmarkdown. everything works perfect except the -->
<!-- # the table, which you can generate by running it in the console, instead of in -->
<!-- # the code chunk. the second to last line in this chunk is the offending line. -->
<!-- # Also I manually changed the variable names in the copy and pasted stargazer -->
<!-- # output below -->
<!-- # library(vegan) -->
<!-- # library(nlme) -->
<!-- # library(lmerTest) -->
<!-- # library(r2glmm) -->
<!-- # ##### -->
<!-- # -->
<!-- # SPs <- read.csv("Data/FF_All_plots.csv") %>% -->
<!-- # dplyr::select(-SS1, -SS2) %>% -->
<!-- # mutate(Plot = substr(Image,1,9)) %>% -->
<!-- # mutate(UNK9 = UNK2 + UNK9) %>% # UNK2 = UNK9! -->
<!-- # mutate(LEPE2 = LEPE2 + LEPE2.1) %>% -->
<!-- # dplyr::select(-UNK2, -Image, -LEPE2.1) %>% -->
<!-- # dplyr::rename(CYMOP2 = CYMO, -->
<!-- # BAPR5 = BAPR, -->
<!-- # ERNA10 = ERNA, -->
<!-- # CRYPT = CRYPTANTHASP, -->
<!-- # ELCA13 = ELCA, -->
<!-- # ACMI2 = ACMI) %>% -->
<!-- # group_by(Plot) %>% -->
<!-- # summarise_all(mean, na.rm=TRUE) %>% -->
<!-- # mutate(Seedling_presence = ifelse(Seedlings > 0 ,1,0))%>% -->
<!-- # dplyr::select(-ssMean, -Seedlings,-Seedling_presence, -LITTER, -BARE, -SHADOW, -->
<!-- # -UNCLEAR, -WOOD, -SCAT, -DUNG, -ROCK,-CRUST) %>% -->
<!-- # tibble::column_to_rownames("Plot") -->
<!-- # -->
<!-- # n_sp <- read.csv("Data/FF_plot_level.csv") %>% -->
<!-- # dplyr::rename(plot = X)%>% -->
<!-- # mutate(FF = as.factor(FF), -->
<!-- # block = substr(plot, 1, 3), -->
<!-- # block = as.factor(ifelse(block == "F03", "F05", block))) %>% -->
<!-- # dplyr::select(plot, sum_spp,FF, block,Elevation) -->
<!-- # -->
<!-- # lspn <- log(specnumber(SPs)) %>% -->
<!-- # as.data.frame() %>% -->
<!-- # tibble::rownames_to_column("plot") %>% -->
<!-- # dplyr::rename(lspn = ".") -->
<!-- # -->
<!-- # shannon <- diversity(SPs, index = "shannon") %>% -->
<!-- # as.data.frame() %>% -->
<!-- # tibble::rownames_to_column("plot") %>% -->
<!-- # dplyr::rename(shannon_weaver = ".") -->
<!-- # -->
<!-- # simpson <- diversity(SPs, index = "simpson") %>% -->
<!-- # as.data.frame() %>% -->
<!-- # tibble::rownames_to_column("plot") %>% -->
<!-- # dplyr::rename(simpson = ".") -->
<!-- # -->
<!-- # invsimpson <- diversity(SPs, index = "invsimpson") %>% -->
<!-- # as.data.frame() %>% -->
<!-- # tibble::rownames_to_column("plot") %>% -->
<!-- # dplyr::rename(inverse_simpson = ".") -->
<!-- # -->
<!-- # adiv <- left_join(shannon, simpson)%>% -->
<!-- # left_join(invsimpson)%>% -->
<!-- # left_join(lspn) %>% -->
<!-- # mutate(pielou_evenness = shannon_weaver/lspn) %>% -->
<!-- # dplyr::select(-lspn) -->
<!-- # -->
<!-- # comm <- decostand(SPs, method = "total") -->
<!-- # -->
<!-- # bdmod_sim <- betadisper(betadiver(comm, 1),n_sp$FF) -->
<!-- # s <- data.frame(bdmod_sim$distances, bdmod_sim$group) %>% -->
<!-- # dplyr::select(beta_diversity = bdmod_sim.distances) %>% -->
<!-- # mutate(plot = rownames(.)) -->
<!-- # -->
<!-- # brte <- tibble::rownames_to_column(SPs,"plot")%>% -->
<!-- # dplyr::select(plot, Cheatgrass_cover = BRTE) %>% -->
<!-- # left_join(adiv) %>% -->
<!-- # left_join(n_sp) %>% -->
<!-- # left_join(s) %>% -->
<!-- # dplyr::select(-simpson,-inverse_simpson) -->
<!-- # -->
<!-- # # lmms, generating R2 -->
<!-- # -->
<!-- # mods<-list() -->
<!-- # mods$sw <- lme(shannon_weaver ~ Cheatgrass_cover + Elevation, random = ~1|block, data = brte) -->
<!-- # mods$pe <- lme(pielou_evenness ~ Cheatgrass_cover + Elevation, random = ~1|block, data = brte) -->
<!-- # mods$ns <- lme(sum_spp ~ Cheatgrass_cover + Elevation, random = ~1|block, data = brte) -->
<!-- # mods$bd <- lme(beta_diversity ~ Cheatgrass_cover+Elevation, random = ~1|block, data = brte) -->
<!-- # -->
<!-- # pr2brte <- c() -->
<!-- # for(i in 1:4){ -->
<!-- # x<- r2beta(mods[[i]]) -->
<!-- # pr2brte[i] <- round(x[x$Effect=="BRTE", ]$Rsq,2) -->
<!-- # } -->
<!-- # pr2brte <- c("partial R2 BRTE", pr2brte) -->
<!-- # stargazer(mods, title = "Results of linear mixed models testing the relationship between diversity indexes and cheatgrass abundance, while accounting for elevation. Study block was the random effect.", -->
<!-- # type = "latex", -->
<!-- # omit.stat = c('aic','bic', 'll'), -->
<!-- # add.lines=list(pr2brte), #somehow adding this line doesn't work in rmarkdown but works in the console fml -->
<!-- # header=F) -->
<!-- # ``` -->
\begin{table}[!htbp] \centering
\caption{Results of linear mixed models testing the relationship between diversity indexes and cheatgrass abundance, while accounting for elevation. Study block was the random effect. Partial coefficient of determination was calculated from Jeager et al. (2016)}
\label{}
\begin{tabular}{@{\extracolsep{5pt}}lcccc}
\\[-1.8ex]\hline
\hline \\[-1.8ex]
& \multicolumn{4}{c}{\textit{Dependent variable:}} \\
\cline{2-5}
\\[-1.8ex] & Shannon-Weaver & Pielou Evenness & Number of Species & Beta Diversity \\
\hline \\[-1.8ex]
Cheatgrass Cover & $-$0.017$^{***}$ & $-$0.008$^{***}$ & $-$0.071$^{***}$ & 0.002 \\
& (0.003) & (0.002) & (0.027) & (0.001) \\
& & & & \\
Elevation & 0.189$^{***}$ & 0.046 & 1.700$^{***}$ & 0.065$^{***}$ \\
& (0.062) & (0.029) & (0.642) & (0.021) \\
& & & & \\
Constant & 1.214$^{***}$ & 0.652$^{***}$ & 8.538$^{***}$ & 0.288$^{***}$ \\
& (0.103) & (0.052) & (1.121) & (0.037) \\
& & & & \\
\hline \\[-1.8ex]
partial R\textsuperscript{2}, Cheatgrass Cover & 0.65 & 0.51 & 0.24 & 0.08 \\
\hline
\hline \\[-1.8ex]
\textit{Note:} & \multicolumn{4}{r}{$^{*}$p$<$0.1; $^{**}$p$<$0.05; $^{***}$p$<$0.01} \\
\end{tabular}
\end{table}
\clearpage
\newpage
Table 3. PERMANOVA results for fire history and environmental factors influencing post-fire **community composition**.
```{r}
source("tables.R")
options(knitr.kable.NA = '')
kable(admod_hc$aov.tab,digits = 4)
```
\clearpage
\newpage
Table 4. PERMANOVA results for fire history and environmental factors influencing post-fire **beta diversity** (Whittaker's index).
```{r}
kable(admod_bd_w$aov.tab, digits =4)
```