-
Notifications
You must be signed in to change notification settings - Fork 2
/
.Rhistory
512 lines (512 loc) · 19.5 KB
/
.Rhistory
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
library(car)
library(MuMIn)
library(RColorBrewer)
require(tidyverse)
library(lsmeans)
# DATA IMPRT AND CLEANING
csc <- read.csv("./data/pcl_output_20201109.csv")
#pft <- read.csv("neon_pft_plots.csv")
csc$pft[csc$pft == "BDF"] <- "DBF"
# cleaning
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) %>%
group_by(plotID, siteID, pft) %>%
summarise_at(.vars = vars(moch, can.max.ht, rugosity, enl, fhd),
.funs = "mean") %>%
data.frame() -> cst
names(cst) <- gsub(x = names(cst), pattern = "\\.", replacement = "_")
# 1) model without any random effects
rug.max.ht <- lm(log10(rugosity) ~ log10(can_max_ht), data = cst)
# 2) model with random intercept
rug.max.ht.int <- lmer(log10(rugosity) ~ log10(can_max_ht) + (1|pft), data = cst, REML = FALSE)
# 3) model with random slope
rug.max.ht.slope <- lmer(log10(rugosity) ~ (log10(can_max_ht)|pft), data = cst, REML = FALSE)
# 4) model with random slope and random intercept, see which has lowest AIC
rug.max.ht.int.slope <- lmer(log10(rugosity) ~ (log10(can_max_ht)|pft) + (1|pft), data = cst, REML = FALSE)
# AICc values
AICc(rug.max.ht)
AICc(rug.max.ht.int)
AICc(rug.max.ht.slope)
AICc(rug.max.ht.int.slope)
ranef(rug.max.ht.int.slope)
# anova results
anova(rug.max.ht, rug.max.ht.int, rug.max.ht.slope, rug.max.ht.int.slope)
#####
model <- lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(log10(enl) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
m.lst
model
model <- lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
print(model)
####### #LAYERING LINEAR MODELS
cst %>%
filter(pft == "ENF") %>%
data.frame() -> enf
summary(lm(enl ~ can_max_ht, data = enf))
cst %>%
filter(pft == "DBF") %>%
data.frame() -> DBF
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
confint(lm(log10(enl) ~ log10(can_max_ht), data = DBF))
#confint(lm(enl ~ can_max_ht, data = DBF))
slopes <- data.frame(pft = "",
var = "",
slope = 0,
ci = 0)
#—DBF -2.29 +/- 0.19; ENF -3.70 +/- 0.59; MF -3.16 +/- 0.55 (p = <0.0001 for each combination
## DBF
# Rc ~ Hmax
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
confint(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
model <- lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
print(model)
summary(model)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
lm(log10(rugosity) ~ log10(can_max_ht), data = cst)
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
summary(aov.pft1 <- aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst))
summary(lm(log10(rugosity) ~ log10(moch), data = DBF))
confint(lm(log10(rugosity) ~ log10(moch), data = DBF))
## Do analyses on the power-law relationship of canopy height vs complexity
# rm(list=ls())
library(lmerTest)
library(car)
library(MuMIn)
library(RColorBrewer)
require(tidyverse)
library(lsmeans)
# DATA IMPRT AND CLEANING
csc <- read.csv("./data/pcl_output_20201109.csv")
#pft <- read.csv("neon_pft_plots.csv")
csc$pft[csc$pft == "BDF"] <- "DBF"
# cleaning
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) %>%
group_by(plotID, siteID, pft) %>%
summarise_at(.vars = vars(moch, can.max.ht, rugosity, enl, fhd),
.funs = "mean") %>%
data.frame() -> cst
names(cst) <- gsub(x = names(cst), pattern = "\\.", replacement = "_")
# 1) model without any random effects
rug.max.ht <- lm(log10(rugosity) ~ log10(can_max_ht), data = cst)
# 2) model with random intercept
rug.max.ht.int <- lmer(log10(rugosity) ~ log10(can_max_ht) + (1|pft), data = cst, REML = FALSE)
# 3) model with random slope
rug.max.ht.slope <- lmer(log10(rugosity) ~ (log10(can_max_ht)|pft), data = cst, REML = FALSE)
# 4) model with random slope and random intercept, see which has lowest AIC
rug.max.ht.int.slope <- lmer(log10(rugosity) ~ (log10(can_max_ht)|pft) + (1|pft), data = cst, REML = FALSE)
# AICc values
AICc(rug.max.ht)
AICc(rug.max.ht.int)
AICc(rug.max.ht.slope)
AICc(rug.max.ht.int.slope)
ranef(rug.max.ht.int.slope)
# anova results
anova(rug.max.ht, rug.max.ht.int, rug.max.ht.slope, rug.max.ht.int.slope)
#####
model <- lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
print(model)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(log10(enl) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(enl ~ can_max_ht*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(log10(fhd) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
# INTERCEPTS
model <- lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lsmeans(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(log10(enl) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lsmeans(model, "pft", var = "can_max_ht")
pairs(m.lst)
model <- lm(log10(fhd) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lsmeans(model, "pft", var = "can_max_ht")
pairs(m.lst)
# PFT specific datasets
cst %>%
filter(pft == "DBF") %>%
data.frame() -> DBF
cst %>%
filter(pft == "MF") %>%
data.frame() -> MF
cst %>%
filter(pft == "ENF") %>%
data.frame() -> ENF
### OLS regressions
# Rc ~ Hmax
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
confint(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = ENF))
confint(lm(log10(rugosity) ~ log10(can_max_ht), data = ENF))
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = MF))
confint(lm(log10(rugosity) ~ log10(can_max_ht), data = MF))
# FHD ~ Hmax
summary(lm(log10(fhd) ~ log10(can_max_ht), data = BDF))
confint(lm(log10(fhd) ~ log10(can_max_ht), data = BDF))
summary(lm(log10(fhd) ~ log10(can_max_ht), data = ENF))
confint(lm(log10(fhd) ~ log10(can_max_ht), data = ENF))
summary(lm(log10(fhd) ~ log10(can_max_ht), data = MF))
confint(lm(log10(fhd) ~ log10(can_max_ht), data = MF))
# ENL ~ Hmax
summary(lm(log10(enl) ~ log10(can_max_ht), data = BDF))
confint(lm(log10(enl) ~ log10(can_max_ht), data = BDF))
summary(lm(log10(enl) ~ log10(can_max_ht), data = ENF))
confint(lm(log10(enl) ~ log10(can_max_ht), data = ENF))
summary(lm(log10(enl) ~ log10(can_max_ht), data = MF))
confint(lm(log10(enl) ~ log10(can_max_ht), data = MF))
#write.csv(cst, "power_law_csc_subset_20201110.csv")
# Rc ~ Hmax
summary(lm(log10(rugosity) ~ log10(moch), data = DBF))
confint(lm(log10(rugosity) ~ log10(moch), data = DBF))
summary(lm(log10(rugosity) ~ log10(moch), data = ENF))
confint(lm(log10(rugosity) ~ log10(moch), data = ENF))
summary(lm(log10(rugosity) ~ log10(moch), data = MF))
confint(lm(log10(rugosity) ~ log10(moch), data = MF))
# FHD ~ Hmax
summary(lm(log10(fhd) ~ log10(moch), data = BDF))
confint(lm(log10(fhd) ~ log10(moch), data = BDF))
summary(lm(log10(fhd) ~ log10(moch), data = ENF))
confint(lm(log10(fhd) ~ log10(moch), data = ENF))
summary(lm(log10(fhd) ~ log10(moch), data = MF))
confint(lm(log10(fhd) ~ log10(moch), data = MF))
# ENL ~ Hmax
summary(lm(log10(enl) ~ log10(moch), data = BDF))
confint(lm(log10(enl) ~ log10(moch), data = BDF))
summary(lm(log10(enl) ~ log10(moch), data = ENF))
confint(lm(log10(enl) ~ log10(moch), data = ENF))
summary(lm(log10(enl) ~ log10(moch), data = MF))
confint(lm(log10(enl) ~ log10(moch), data = MF))
# Rc ~ Hmax
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
lstrends(model, "pft", var = "can_max_ht")
lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
summary(lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst))
aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst))
summary(lm(log10(rugosity) ~ log10(can_max_ht), data = DBF))
aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst))
head(Cst)
head(cst)
?aov
aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst))
aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst)
lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst)
summary(lm(log10(rugosity) ~ log10(can_max_ht)*pft, data = cst))
summary(aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst))
summary(aov(log10(enl) ~ log10(moch) * pft, data = cst))
summary(aov(log10(fhd) ~ log10(moch) * pft, data = cst))
summary(aov(log10(rugosity) ~ log10(moch) * pft, data = cst))
TukeyHSD(aov(log10(enl) ~ log10(can_max_ht) * pft, data = cst), "pft")
TukeyHSD(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst), "pft")
summary(aov(log10(fhd) ~ log10(moch) * pft, data = cst))
#### FHD
summary(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst))
TukeyHSD(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst), "pft")
summary(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst))
TukeyHSD(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst), "pft")
model <- lm(log10(fhd) ~ log10(can_max_ht)*pft, data = cst)
m.lst <- lstrends(model, "pft", var = "can_max_ht")
pairs(m.lst)
model
summary(model)
m.lst
pairs(m.lst)
summary(aov(log10(rugosity) ~ log10(moch) * pft, data = cst))
TukeyHSD(aov(log10(rugosity) ~ log10(moch) * pft, data = cst), "pft")
head(cst)
M <- cor(cst[, c(6:8)])
M <- cor(cst[, c(4:8)])
x11()
corrplot::corrplot(M)
corrplot::corrplot(M, sig.level = 0.05)
x11()
corrplot::corrplot(M, method = "number")
M <- cor(cst[, c(6:8)])
x11()
corrplot::corrplot(M, method = "number")
fd_litter()
fortedata::fd_litter()
summary(fortedata::fd_litter())
chm
TukeyHSD(aov(log10(enl) ~ log10(can_max_ht) * pft, data = cst), "pft")
TukeyHSD(aov(log10(enl) ~ log10(moch) * pft, data = cst), "pft")
TukeyHSD(aov(log10(fhd) ~ log10(can_max_ht) * pft, data = cst), "pft")
summary(aov(log10(fhd) ~ log10(moch) * pft, data = cst))
TukeyHSD(aov(log10(fhd) ~ log10(moch) * pft, data = cst), "pft")
TukeyHSD(aov(log10(rugosity) ~ log10(can_max_ht) * pft, data = cst), "pft")
TukeyHSD(aov(log10(rugosity) ~ log10(moch) * pft, data = cst), "pft")
##################
power.law <- read.csv("./data/power_law_diagnostic.csv")
head(power.law)
power.law <- read.csv("./data/power_law_diagnostic.csv")
gsub("[^[:alnum:]]", " ", power.law$PFT)
# remove all
power.law$PFT <- gsub("[^[:alnum:]]", " ", power.law$PFT)
power.law$PFT <- gsub(" ", "", power.law$PFT, fixed = TRUE)
head(power.law)
power.law %>%
dplyr::filter(PFT != "ALL") %>%
data.frame() -> power.law
power.law
power.law <- read.csv("./data/power_law_diagnostic.csv")
# remove all
power.law$PFT <- gsub("[^[:alnum:]]", " ", power.law$PFT)
power.law$PFT <- gsub(" ", "", power.law$PFT, fixed = TRUE)
power.law %>%
dplyr::filter(PFT != "ALL") %>%
dplyr::filter(PFT == "OLS") %>%
data.frame() -> power.law
power.law
power.law <- read.csv("./data/power_law_diagnostic.csv")
# remove all
power.law$PFT <- gsub("[^[:alnum:]]", " ", power.law$PFT)
power.law$PFT <- gsub(" ", "", power.law$PFT, fixed = TRUE)
power.law %>%
dplyr::filter(PFT != "ALL") %>%
dplyr::filter(Regression.Method == "OLS") %>%
data.frame() -> power.law
power.law
install.packages("ggsignif")
library(ggplot2)
library(ggsignif)
##################
power.law <- read.csv("./data/power_law_diagnostic.csv")
# remove all
power.law$PFT <- gsub("[^[:alnum:]]", " ", power.law$PFT)
power.law$PFT <- gsub(" ", "", power.law$PFT, fixed = TRUE)
power.law %>%
dplyr::filter(PFT != "All") %>%
dplyr::filter(Regression.Method == "OLS") %>%
data.frame() -> power.law
power.law
x11()
ggplot(power.law, aes(x = PFT, y = Slope, fill = Y)) +
geom_bar(stat = "identity")
x11()
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity")
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2)
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
ggtitle("Sample") + labs(y = "DV") +
theme(plot.title = element_text(hjust = 0.5))+
facet_grid(y ~ X)
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
ggtitle("Sample") + labs(y = "DV") +
theme(plot.title = element_text(hjust = 0.5))+
facet_wrap(y ~ X)
x11()
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
ggtitle("Sample") + labs(y = "Slope") +
theme(plot.title = element_text(hjust = 0.5))+
facet_wrap(X ~ y)
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
theme_classic()+
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
ggtitle("Sample") + labs(y = "Slope") +
theme(plot.title = element_text(hjust = 0.5))+
facet_wrap(X ~ y)
x11()
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
theme_bw()+
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
ggtitle("Sample") + labs(y = "Slope") +
theme(plot.title = element_text(hjust = 0.5))+
facet_wrap(X ~ y)
x11()
ggplot(power.law, aes(x = PFT, y = Slope, fill = y)) +
geom_bar(stat = "identity") +
theme_bw()+
geom_errorbar(aes(ymin = Slope - b_lower, ymax = Slope + b_upper), width = .2) +
geom_signif(comparisons = list(c("A", "B")), annotations="***", y_position = 2.2, tip_length = 0.03) +
geom_signif(comparisons = list(c("A", "C")), annotations="***", y_position = 2.6, tip_length = 0.03) +
geom_signif(comparisons = list(c("B", "C")), annotations="***", y_position = 2.4, tip_length = 0.03) +
labs(y = "Slope") +
theme(plot.title = element_text(hjust = 0.5))+
facet_wrap(X ~ y)
library(lmerTest)
library(car)
library(MuMIn)
library(RColorBrewer)
require(tidyverse)
library(lsmeans)
# DATA IMPRT AND CLEANING
csc <- read.csv("./data/pcl_output_20201109.csv")
#pft <- read.csv("neon_pft_plots.csv")
csc$pft[csc$pft == "BDF"] <- "DBF"
# cleaning
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) %>%
group_by(plotID, siteID, pft) %>%
summarise_at(.vars = vars(moch, can.max.ht, rugosity, enl, fhd),
.funs = "mean") %>%
data.frame() -> cst
names(cst) <- gsub(x = names(cst), pattern = "\\.", replacement = "_")
head(Cst)
head(Cst)
head(cst)
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) %>%
group_by(plotID, siteID, pft) %>%
summarise_at(.vars = vars(moch, can.max.ht, rugosity, enl, fhd),
.funs = "mean") %>%
summarise(transect.length = sum(transect.length))%>%
data.frame() -> cst
names(cst) <- gsub(x = names(cst), pattern = "\\.", replacement = "_")
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) %>%
group_by(plotID, siteID, pft) %>%
summarise(transect.length = sum(transect.length))%>%
data.frame() -> cst.length
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft) %>%
group_by(plotID, siteID, pft) %>%
summarise(transect.length = sum(transect.length, na.rm = TRUE))%>%
data.frame() -> cst.length
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft) %>%
group_by(plotID, siteID, pft)
head(Csc)
head(csc)
View(cst)
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft) %>%
group_by(plotID, siteID, pft) %>%
summarise(transect.length = sum(transect.length, na.rm = TRUE))
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft) %>%
group_by(plotID, siteID, pft) %>%
summarise(transect.length = sum(transect.length, na.rm = TRUE))%>%
data.frame() -> cst.length
View(cst.length)
names(cst.length) <- gsub(x = names(cst.length), pattern = "\\.", replacement = "_")
# test for differences in transect length
cst.test <- merge(cst.length, cst)
cst.test
x11()
plot(cst.test$transect_length, cst.test$rugosity)
x11()
plot(cst.test$transect_length, cst.test$moch)
x11()
plot(cst.test$rugosity/cst.test$transect_length, cst.test$moch/cst.test$transect_length)
summary(cst$siteID)
table(cst$siteID)
table(cst.test$siteID, cst.test$transect.length)
cst.test %>%
group_by(siteID) %>%
summarise(transect.length = sum(transect.length, na.rm = TRUE))
head(cst.test)
cst.test %>%
group_by(siteID) %>%
summarise(transect.length = sum(transect_length, na.rm = TRUE))
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd)
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") %>%
filter(plotID != "?" & plotID != "") %>%
select(siteID, plotID, transect.length, pft, moch, can.max.ht, rugosity,
enl, fhd) -> no.count
length(no.count)
no.count
dim(no.count)
csc %>%
filter(cover.fraction > 25) %>%
filter(can.max.ht < 50) %>%
filter(management == "unmanaged") %>%
filter(disturbance == "") -> no.count
dim(no.count)
400000 * 0.05
300000 * 0.05