-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rscript fire and vegetation reconstructions.R
1250 lines (1049 loc) · 70.5 KB
/
Rscript fire and vegetation reconstructions.R
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
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# UTF-8
# Project : PhD in environmental sciences 2017-2020
# Author: Dorian Gaboriau - gaboriau.dorian@gmail.com - dorian.gaboriau@uqat.ca
# Thesis: Natural factors of large wildfires in the boreal forest and prediction of future fire activity in the Northwest Territories, Canada
# Chapter 2 : Reconstitution and caracterization of the past fire regimes, vegetation and comparison with past climatic conditions (Holocene period) in the central NWT, Canada
# Author : Gaboriau Dorian
# Last update : October 2020
rm(list = ls()) # Deleting variables from the environment R
##########################################################################################################
#Reconstruction of Biomass Burning
##########################################################################################################
# Installation and importation of libraries
# Install paleofire package with github of Olivier Blarquez
#devtools::install_github("paleofire/paleofire")
library(devtools)
library(paleofire)
library(ggplot2)
library(GCD)
#Charge work environment
setwd("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Fire_history/")
## Data for EMILE LAKE ## - file corresponding to INPUTS of CharAnalysis
files=c("BBEmile.csv")
#colnames(files) = c("DepthTop", "DepthBottom", "AgeTop", "AgeBottom", "Volume", "Charcoal")
metadata=c("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Location_sites/metadata_emile.csv")
mydata=pfAddData(files=files, metadata = metadata, type="CharAnalysis", sep = ";", dec = ".")
#Charcoal data transformation, background estimation and homogenization for unique to multiple series
TR1=pfTransform(add=mydata, method=c("MinMax","Box-Cox","Z-Score"))
#Produces a composite series from multiple charcoal records by using a robust locally weighted scatterplot smoother (LOWESS = locfit function from the locfit package and is applied repeatedly (nboot times) on bootstrapped charcoal sites samples. The records charcoal values are pre-binned prior to sites resampling (Daniau et al. (2012)).
COMP2=pfCompositeLF(TR1, hw=250, nboot=1000, tarAge=seq(-68,9530,1), conf = c(0.05, 0.95)) #hw = demi-largeur de fenetre
plot(COMP2,ylim=c(-2,2),main=c("Emile"))
EmileBB<-as.data.frame(COMP2$Result[,1:2])
colnames(EmileBB)=c("Age","LocFit")
## Data for IZAAC LAKE ##
files=c("BBIzaac.csv")
#colnames(files) = c("DepthTop", "DepthBottom", "AgeTop", "AgeBottom", "Volume", "Charcoal")
metadata=c("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Location_sites/metadata_izaac.csv")
mydata=pfAddData(files=files, metadata = metadata, type="CharAnalysis", sep = ";", dec = ".")
TR1=pfTransform(add=mydata, method=c("MinMax","Box-Cox","Z-Score"))
COMP3=pfCompositeLF(TR1, hw=250, nboot=1000, tarAge=seq(-68,9530,1), conf = c(0.05, 0.95))
plot(COMP3,ylim=c(-2,2),main=c("Izaac"))
IzaacBB<-as.data.frame(COMP3$Result[,1:2])
colnames(IzaacBB)=c("Age","LocFit")
## Data for PARADIS LAKE ##
files=c("BBParadis.csv")
#colnames(files) = c("DepthTop", "DepthBottom", "AgeTop", "AgeBottom", "Volume", "Charcoal")
metadata=c("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Location_sites/metadata_paradis.csv")
mydata=pfAddData(files=files, metadata = metadata, type="CharAnalysis", sep = ";", dec = ".")
TR1=pfTransform(add=mydata, method=c("MinMax","Box-Cox","Z-Score"))
COMP5=pfCompositeLF(TR1, hw=250, nboot=1000, tarAge=seq(-68,9530,1), conf = c(0.05, 0.95))
plot(COMP5,ylim=c(-2,2),main=c("Paradis"))
ParadisBB<-as.data.frame(COMP5$Result[,1:2])
colnames(ParadisBB)=c("Age","LocFit")
## Data for SAXON LAKE ##
files=c("BBSaxon.csv")
#colnames(files) = c("DepthTop", "DepthBottom", "AgeTop", "AgeBottom", "Volume", "Charcoal")
metadata=c("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Location_sites/metadata_saxon.csv")
mydata=pfAddData(files=files, metadata = metadata, type="CharAnalysis", sep = ";", dec = ".")
TR1=pfTransform(add=mydata, method=c("MinMax","Box-Cox","Z-Score"))
COMP4=pfCompositeLF(TR1, hw=250, nboot=1000, tarAge=seq(-68,9530,1), conf = c(0.05, 0.95))
plot(COMP4,ylim=c(-2,2),main=c("Saxon"))
SaxonBB<-as.data.frame(COMP4$Result[,1:2])
colnames(SaxonBB)=c("Age","LocFit")
#Merge BB of each lakes
BB = merge(EmileBB, IzaacBB, by='Age')
BB = merge(BB, ParadisBB, by = 'Age')
colnames(BB) = c("Age","Emile", "Izaac", "Paradis")
BB = merge(BB, SaxonBB, by = 'Age')
colnames(BB) = c("Age", "EmileBB", "IzaacBB", "ParadisBB", "SaxonBB")
#Measure the mean of biomass burning to have a regional value (BB_mean)
BB[,6]<-apply(BB[,2:ncol(BB)],1,mean,na.rm=T)
colnames(BB)=c("Age","EmileBB", "IzaacBB", "ParadisBB", "SaxonBB", "BBmean")
head(BB)
write.csv(BB,file="BB_merge_250.csv",row.names = FALSE)
#Plot BB of each lakes after having substracted the mean of reference period to each subsample from the file precedently created
dev.off()
#Use the file with measured anomalies
BB<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Fire_history/BB250_anomalies.csv",h=T,sep=";")
colnames(BB) = c("Age", "EmileBB", "IzaacBB", "ParadisBB", "SaxonBB", "BBmean")
plot(BB$SaxonBB,xlim = rev(range(BB$Age)),type="l", ylim = c(-2,3), lwd = 2, ylab = "", col = "blue", cex.axis=1.3)
lines(BB$Age,BB$IzaacBB, col= "forestgreen", lwd = 2)
lines(BB$Age,BB$ParadisBB, col= "red", lwd = 2)
lines(BB$Age,BB$EmileBB, col= "black", lwd = 2)
abline(mean(BB$BBmean[69:569]),0) # = periode ca. 500 yr. BP to 0 (1950)
##########################################################################################################
#Reconstruction of Fire frequency
##########################################################################################################
# Importation of libraries
library(devtools)
library(paleofire)
# Create a file for each lake, with the date of fire peaks (significant peaks)
Lakes_fires<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Fire_history/Lake_fire_frequency.csv",h=T,sep=";")
Emilefires<-Lakes_fires[,1]
Emilefires<-Emilefires[!is.na(Emilefires)]
Izaacfires<-Lakes_fires[,2]
Izaacfires<-Izaacfires[!is.na(Izaacfires)]
Paradisfires<-Lakes_fires[,3]
Paradisfires<-Paradisfires[!is.na(Paradisfires)]
Saxonfires<-Lakes_fires[,4]
Saxonfires<-Saxonfires[!is.na(Saxonfires)]
Saxonfires
#Measure of FF
fevent=c(Emilefires)
#Computes paleo-fire frequency for a set of fire events (or frequency from other events types, see examples) using a gaussian kernel density estimation procedure based on a defined bandwidth (see Mudelsee 2004 for details). Pseudo-replicated values are used to correct for edge bias, equivalent to "minimum slope" correction in Mann (2004).
ffEmile=kdffreq(fevent,up=-68,lo=9530, bandwidth = 500, nbboot=1000,alpha = 0.1, pseudo = FALSE)
#pseudo=FALSE is important because it disables the correction of Mann 2004 (pdf of paleofire package)
mat_ffEmile<-matrix(cbind(ffEmile$age,ffEmile$ff),ncol=2)
plot.kdffreq(ffEmile,ylim=c(0,0.015),xlim=c(10000,0),bty="n")
mat_ffEmile
colnames(mat_ffEmile)=c("Age","ff")
fevent=c(Izaacfires)
ffIzaac=kdffreq(fevent,up=-68,lo=9530, bandwidth = 500, nbboot=1000,alpha = 0.1, pseudo=FALSE)
mat_ffIzaac<-matrix(cbind(ffIzaac$age,ffIzaac$ff),ncol=2)
plot.kdffreq(ffIzaac,ylim=c(0,0.015),xlim=c(10000,0),bty="n")
mat_ffIzaac
colnames(mat_ffIzaac)=c("Age","ff")
fevent=c(Paradisfires)
ffParadis=kdffreq(fevent,up=-68,lo=9530,bandwidth = 500, nbboot=1000,alpha = 0.1,pseudo=FALSE)
mat_ffParadis<-matrix(cbind(ffParadis$age,ffParadis$ff),ncol=2)
plot.kdffreq(ffParadis,ylim=c(0,0.015),xlim=c(10000,0),bty="n")
mat_ffParadis
colnames(mat_ffParadis)=c("Age","ff")
fevent=c(Saxonfires)
ffSaxon=kdffreq(fevent,up=-68, lo=9530,bandwidth = 500, nbboot=1000,alpha = 0.1,pseudo=FALSE)
mat_ffSaxon<-matrix(cbind(ffSaxon$age,ffSaxon$ff),ncol=2)
plot.kdffreq(ffSaxon,ylim=c(0,0.015),xlim=c(10000,0),bty="n")
mat_ffSaxon
colnames(mat_ffSaxon)=c("Age","ff")
#Plot FF of each lakes
plot(ffEmile$age, ffEmile$ff, xlim = rev(range(ffEmile$age)),type="l", ylab = "", xlab = "", ylim = c(0,0.010), lwd = 2, col = "black", cex.axis=1.3)
lines(ffIzaac$age,ffIzaac$ff, col="forestgreen", lwd = 2)
lines(ffParadis$age,ffParadis$ff, col="red", lwd = 2)
lines(ffSaxon$age,ffSaxon$ff, col="blue", lwd = 2)
#As dates are interpolated with the function kdffreq, they are not the same for each lake
#Do a linear approximation all 10 years (or more or less)
mat_ffEmile<-approx(mat_ffEmile[,1],mat_ffEmile[,2],method="linear",xout=seq(-68,9530,by=1), rule = 2)
mat_ffIzaac<-approx(mat_ffIzaac[,1],mat_ffIzaac[,2],method="linear",xout=seq(-69,9530,by=1), rule = 2)
mat_ffParadis<-approx(mat_ffParadis[,1],mat_ffParadis[,2],method="linear",xout=seq(-68,9530,by=1), rule = 2)
mat_ffSaxon<-approx(mat_ffSaxon[,1],mat_ffSaxon[,2],method="linear",xout=seq(-68,9530,by=1), rule = 2)
FF<-as.data.frame(cbind(mat_ffEmile$x,mat_ffEmile$y, mat_ffIzaac$y, mat_ffParadis$y, mat_ffSaxon$y))
colnames(FF) = c("Age", "EmileFF", "IzaacFF", "ParadisFF", "SaxonFF")
dim(FF)
head(FF)
FF[,6]<-apply(FF[,2:5],1, mean)
head(FF)
colnames(FF)=c("Age","FFEmile","FFIzaac","FFParadis","FFSaxon", "FFmean")
abline(mean(FF$FFmean), 0)
write.csv(FF,file="FF_merge_500.csv",row.names = FALSE)
#Plot FF of each lakes after having substracted the mean of referecne period to each subsample from the file precedently created
dev.off()
#Use the file with measured anomalies
FF<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Fire_history/FF500_anomalies.csv",h=T,sep=";")
colnames(FF) = c("Age", "EmileFF", "IzaacFF", "ParadisFF", "SaxonFF", "FFmean")
plot(FF$SaxonFF,xlim = rev(range(FF$Age)),type="l", ylim = c(-0.003,0.006), lwd = 2, ylab = "", col = "blue", cex.axis=1.3)
lines(FF$Age,FF$IzaacFF, col= "forestgreen", lwd = 2)
lines(FF$Age,FF$ParadisFF, col= "red", lwd = 2)
lines(FF$Age,FF$EmileFF, col= "black", lwd = 2)
abline(mean(FF$FFmean[69:569]),0)
#####################################################################################################################
#Measure RegFF
#####################################################################################################################
dev.off()
par(mfrow = c(4,1), mar = c(0.1,7,4,0.1))
#Import Libraries
library(boot)
#File with fire frequency for each lake and mean for each year (corrected with the difference with the mean of ca. 3000-0 yr. BP)
FFSap<-read.csv("FF500_anomalies.csv",h=T,sep=";")
FFSap<-na.omit(FFSap)
FFSap_plot<-FFSap[,c("FFEmile","FFIzaac","FFParadis","FFSaxon")]
my.data<-as.data.frame(t(FFSap_plot))
R<-999
l=length(my.data[1,])
bootCI<-as.data.frame(matrix(ncol=3,nrow=l))
boot.mean<-function(y,m)
{z<-mean(y[m])
z}
for(i in 1:l) {
y<-my.data[,i]
y<-na.omit(y)
boot.obj<-boot(y,boot.mean,R)
IC.norm<-boot.ci(boot.obj,conf=0.90,type="norm")
bootCI[i,]<-IC.norm$normal
}
FFBootCISap<-cbind(FFSap$Age,FFSap$FFmean,bootCI)
colnames(FFBootCISap)=c("Age","Mean","CI","Infe","Supe")
FFmean_smoothSap = smooth.spline(FFBootCISap$Age,FFBootCISap$Mean, spar=0.15)
FFmean_infSap = smooth.spline(FFBootCISap$Age, FFBootCISap$Infe, spar=0.15)
FFmean_supSap = smooth.spline(FFBootCISap$Age, FFBootCISap$Supe, spar=0.15)
plot(FFmean_infSap,type="l",xlim=c(9530,-68),ylim=c(-0.004,0.006), axes=F, xlab = " ", xaxt="n", lty = 1, lwd = 2, font.axis=3, cex.axis = 1, ylab = " ", col=c("yellow"), bty="n")
lines(FFmean_supSap,col=c("yellow"), lwd = 2)
polygon(c(FFmean_smoothSap$x,rev(FFmean_smoothSap$x)),c(FFmean_supSap$y,rev(FFmean_infSap$y)),col="yellow", border = NA)
linemeanFF<-mean(FFmean_smoothSap$y[69:569])
lines(FF$Age,FF$IzaacFF, col="orange", lwd = 2.5, lty = 2)
lines(FF$Age,FF$ParadisFF, col="brown", lwd = 2.5, lty = 2)
lines(FF$Age,FF$EmileFF, col="forestgreen", lwd = 2.5, lty = 2)
lines(FF$Age,FF$SaxonFF, col="blue", lwd = 2.5, lty = 2)
lines(FF$Age,FF$FFmean, col= "red", lwd = 3)
abline(a=NULL,b=NULL,h=linemeanFF,v=NULL, col = "black", lwd = 1, lty = 1)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
axis(3,at=c(-68,0,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000), lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5)
#The next two files contain the average of RegBB and RegFF and the INF and SUP bounds of the Confidence Intervals.
write.csv(FFBootCISap,"FFBootCISap.csv",row.names=F)
#####################################################################################################################
#Measure RegBB
#####################################################################################################################
#Import libraries
library(boot)
#File with Burned Biomass for each lake and mean for each year (corrected with the difference with the mean of ca. 3000-0 yr. BP)
BBSap<-read.csv("BB250_anomalies.csv",h=T,sep=";")
#Keep just lakes without mean for bootstrap
BBSap_plot<-BBSap[,c("EmileBB","IzaacBB","ParadisBB","SaxonBB")]
#Confidence interval around RegBB with Boostrap
my.data<-as.data.frame(t(BBSap_plot)) # you return your table (format required to use the boot function)
R<-999 # 1000 is the number of resamples you want in your bootstrap
l=length(my.data[1,])
bootCI<-as.data.frame(matrix(ncol=3,nrow=l)) #You create your empty matrix to accommodate the output data
boot.mean<-function(y,m) #You create your function that will calculate your bootstrap around your average
{z<-mean(y[m])
z}
for(i in 1:l) {
y<-my.data[,i]
y<-na.omit(y)
boot.obj<-boot(y,boot.mean,R)
IC.norm<-boot.ci(boot.obj,conf=0.90,type="norm") #you can change confidence interval (here conf=0.90)
bootCI[i,]<-IC.norm$normal
}
#To add the IC to the dataframe
colnames(BBSap) = c("Age", "EmileBB", "IzaacBB", "ParadisBB", "SaxonBB", "BBmean")
BBBootCISap<-cbind(BBSap$Age,BBSap$BBmean,bootCI)
colnames(BBBootCISap)=c("Age","Mean","CI","Infe","Supe")
BBmean_smoothSap = smooth.spline(BBBootCISap$Age,BBBootCISap$Mean, spar=0.15) #smoothing of the data
#Plot RegBB and IC
BBmean_infSap = smooth.spline(BBBootCISap$Age, BBBootCISap$Infe, spar=0.15)
BBmean_supSap = smooth.spline(BBBootCISap$Age, BBBootCISap$Supe, spar=0.15)
plot(BBmean_infSap,type="l",xlim=c(9530,-68),ylim=c(-1.45,3),col=c("yellow"), axes=F, font.axis=2, xlab = " ", ylab = " ", cex.axis=0.8, lty=1, bty="n", lwd = 2, xaxt="n")
lines(BBmean_supSap,col=c("yellow"), lwd = 2, lty = 1)
polygon(c(BBmean_smoothSap$x,rev(BBmean_smoothSap$x)),c(BBmean_supSap$y,rev(BBmean_infSap$y)),col="yellow", border = NA)
lines(BB$Age,BB$IzaacBB, col= "orange", lwd = 2.5, lty =2)
lines(BB$Age,BB$ParadisBB, col= "brown", lwd = 2.5, lty = 2)
lines(BB$Age,BB$EmileBB, col= "forestgreen", lwd = 2.5, lty = 2)
lines(BB$Age,BB$SaxonBB, col= "blue", lwd = 2.5, lty = 2)
linemeanBB<-mean(BBmean_smoothSap$y[69:569])
lines(BB$Age,BB$BBmean, col= "red", lwd = 3)
abline(a=NULL,b=NULL,h=linemeanBB,v=NULL, col = "black", lwd = 1, lty = 1)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
write.csv(FFBootCISap,"BBBootCISap.csv",row.names=F)
##################################################################################################################
#### FS index
##################################################################################################################
BB<-read.csv("BBBootCISap.csv",h=T,sep=",")
FF<-read.csv("FFBootCISap.csv",h=T,sep=",")
Tot<-merge(BB,FF,by="Age")
BB<-cbind(Tot[,1],Tot[,2],Tot[,3],Tot[,4],Tot[,5])
colnames(BB)<-c("Age","Mean","CI","Infe","Supe")
FF<-cbind(Tot[,1],Tot[,6],Tot[,7],Tot[,8],Tot[,9])
colnames(FF)<-c("Age","Mean","CI","Infe","Supe")
RegBB<-data.frame(BB[,1],BB[,2])
colnames(RegBB)<-c("Age","BBmean")
RegBBmax<-max(RegBB$BBmean)
RegBBmin<-min(RegBB$BBmean)
#Here is a calcul to center your RegBB around the average.# It's not important if you calculate a single RegBB (it won't change your trend but only your RegBB value gradient) but it's very important if you make a comparison of several RegBB/RegFF and/or FS. If this is the case, you have to center all your RegBBs on the average of all your RegBBs because otherwise you will compare results that are not really comparable.
RegBB[,3]<-c((RegBB[,2]-RegBBmin)/(RegBBmax-RegBBmin))
colnames(RegBB)<-c("Age","BBmean","RegBBrescale")
#We add a +1 to have only data higher than 1 (useful for the continuation of the calculation and mention in Olivier's method in the article of the PNAS)
RegBB[,4]<-RegBB$RegBBrescale+1
colnames(RegBB)<-c("Age","BBmean","RegBBrescale","RegBBb")
#Same for RegFF
RegFF<-data.frame(FF[,1],FF[,2])
colnames(RegFF)<-c("Age","FFmean")
RegFFmax<-max(na.omit(RegFF$FFmean))
RegFFmin<-min(na.omit(RegFF$FFmean))
RegFF[,3]<-c((RegFF[,2]-RegFFmin)/(RegFFmax-RegFFmin))
colnames(RegFF)<-c("Age","FFmean","RegFFrescale")
RegFF[,4]<-RegFF$RegFFrescale+1
colnames(RegFF)<-c("Age","FFmean","RegFFrescale","RegFFb")
#Calcul of FS index
FS<-merge(RegBB,RegFF,by="Age",all=T)
FS[,8]<-(FS$RegBBb/FS$RegFFb)
FSspline<-FS[1:nrow(FS),c(1,8)]
colnames(FSspline)<-c("Age","FSindex")
write.csv(FSspline,file="FS500.csv",row.names = FALSE)
#Import file corrected with difference with the reference period ca. 500-0 yr. BP
FSspline = read.csv("FS500_anomalies.csv",h=T,sep=";")
#Then you can make a smooth to make a graph. You can use other methods than smooth.spline.
FSspline<-na.omit(FSspline)
smoothingFSSpline = smooth.spline(FSspline$Age, FSspline$FSindex, spar=0.15)
MAXmean<-RegBBmax
MINmean<-RegBBmin
#Calcul IC around FS index, this time with the confidence intervals around your RegBB and RegFF
BBBootCISap<-read.csv("BBBootCISap.csv",h=T,sep=",")
FFBootCISap<-read.csv("FFBootCISap.csv",h=T,sep=",")
FS_CI<-merge(BBBootCISap,FFBootCISap,by="Age")
FS_CI<-cbind(FS_CI[,1],FS_CI[,2],FS_CI[,4],FS_CI[,5],FS_CI[,6],FS_CI[,8],FS_CI[,9])
colnames(FS_CI)<-c("Age","BBmean","BBinf","BBsup","FFmean","FFinf","FFsup")
write.csv(FS_CI,"FS_CI.csv",row.names=F)
RegBB<-c()
RegFF<-c()
RegBB<-cbind(FS_CI[,1],FS_CI[,3],FS_CI[,2])
RegBB<-data.frame(RegBB)
colnames(RegBB)<-c("Age","BBinf","BBmean")
RegBBmax<-max(RegBB$BBmean)
RegBBmin<-min(RegBB$BBmean)
RegBB[,4]<-c((RegBB[,2]-RegBBmin)/(RegBBmax-RegBBmin))
colnames(RegBB)<-c("Age","BBinf","BBmean","RegBBrescale")
RegBB[,5]<-RegBB$RegBBrescale+1
colnames(RegBB)<-c("Age","BBinf","BBmean","RegBBrescale","RegBBb")
RegFF<-cbind(FS_CI[,1],FS_CI[,7],FS_CI[,5])
RegFF<-data.frame(RegFF)
colnames(RegFF)<-c("Age","FFsup","FFmean")
RegFFmax<-max(RegFF$FFmean)
RegFFmin<-min(RegFF$FFmean)
RegFF[,4]<-c((RegFF[,2]-RegFFmin)/(RegFFmax-RegFFmin))
colnames(RegFF)<-c("Age","FFsup","FFmean","RegFFrescale")
RegFF[,5]<-RegFF$RegFFrescale+1
colnames(RegFF)<-c("Age","FFsup","FFmean","RegFFrescale","RegFFb")
FS_inf<-merge(RegBB,RegFF,by="Age",all=T)
FS_inf<-(FS_inf$RegBBb/FS_inf$RegFFb)
RegBB<-c()
RegFF<-c()
RegBB<-cbind(FS_CI[,1],FS_CI[,4],FS_CI[,2])
RegBB<-data.frame(RegBB)
colnames(RegBB)<-c("Age","BBsup","BBmean")
RegBBmax<-max(RegBB$BBmean)
RegBBmin<-min(RegBB$BBmean)
RegBB[,4]<-c((RegBB[,2]-RegBBmin)/(RegBBmax-RegBBmin))
colnames(RegBB)<-c("Age","BBsup","BBmean","RegBBrescale")
RegBB[,5]<-RegBB$RegBBrescale+1
colnames(RegBB)<-c("Age","BBsup","BBmean","RegBBrescale","RegBBb")
RegFF<-cbind(FS_CI[,1],FS_CI[,6],FS_CI[,5])
RegFF<-data.frame(RegFF)
colnames(RegFF)<-c("Age","FFinf","FFmean")
RegFFmax<-max(RegFF$FFmean)
RegFFmin<-min(RegFF$FFmean)
RegFF[,4]<-c((RegFF[,2]-RegFFmin)/(RegFFmax-RegFFmin))
colnames(RegFF)<-c("Age","FFinf","FFmean","RegFFrescale")
RegFF[,5]<-RegFF$RegFFrescale+1
colnames(RegFF)<-c("Age","FFinf","FFmean","RegFFrescale","RegFFb")
FS_sup<-merge(RegBB,RegFF,by="Age",all=T)
FS_sup<-(FS_sup$RegBBb/FS_sup$RegFFb)
FS_CI<-cbind(FS_CI[,1],FS_inf,FS_sup)
colnames(FS_CI)<-c("Age","Infe","Supe")
write.csv(FS_CI,"FS_CI_2.csv",row.names=F)
#Import file corrected with differences between each subsamples and the mean of the reference period ca. 3000-0 yr. BP
FS_CI<-read.csv("FS_CI_anomalies.csv",h=T,sep=";")
FS<-read.csv("FS500_anomalies.csv",h=T,sep=";")
FS<-merge(FS,FS_CI,by="Age")
FS<-as.data.frame(FS)
smoothingFSSap = smooth.spline(FSspline[,1], FSspline[,2] , spar=0.15)
plot(smoothingFSSap,type="l",xlim=c(9530,-68),ylim=c(-0.5,1.5),col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=2,cex.axis=1.3,bty="n", xaxt="n")
FS_infSap = smooth.spline(FS[,1], FS[,3], spar=0.15)
FS_supSap = smooth.spline(FS[,1], FS[,4], spar=0.15)
lines(FS_infSap,col=c("yellow"), lwd = 2)
lines(FS_supSap,col=c("yellow"), lwd = 2)
polygon(c(smoothingFSSap$x, rev(smoothingFSSap$x)), c(FS_supSap$y, rev(FS_infSap$y)),col = "yellow", border = NA)
lines(smoothingFSSap, col=c("red"), lwd = 3)
linemeanFS<-mean(smoothingFSSap$y[69:569])
abline(a=NULL,b=NULL,h=linemeanFS,v=NULL, col = "black", lwd = 1, lty = 1)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
# Data Reg BB, RegFF, FSindex. Merge in a dataframe
firemetrics = as.data.frame(cbind(BBBootCISap$Age, BBBootCISap$Mean, FFBootCISap$Mean, FSspline$FSindex))
colnames(firemetrics) = c("Age","RegBB", "RegFF", "FSindex")
write.csv(firemetrics,"firemetrics.csv",row.names=F)
################################################################
#VEGETATION reconstructions
################################################################
# Graphic for all taxa POLLEN INFLUX DIAGRAM
setwd("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Vegetation_history/")
# Import data
ma.pollen <- read.csv("Pollen_influx.csv", header=TRUE, sep=";", check.names = FALSE)
#PLOT TREES & SHRUBS
ma.pollen_1 = as.data.frame(cbind(as.numeric(ma.pollen$`age`), ma.pollen$PAR, ma.pollen$Picea, ma.pollen$Betula, ma.pollen$Pinus, ma.pollen$Populus, ma.pollen$Alnus.crispa, ma.pollen$Alnus.rugosa, ma.pollen$Juniperus, ma.pollen$Salix, ma.pollen$Larix))
colnames(ma.pollen_1) = c("Age", "PAR", "Picea", "Betula", "Pinus", "Populus", "Alnus crispa", "Alnus rugosa", "Juniperus","Salix", "Larix")
ma.pollen_1 = ma.pollen_1[1:148,]
# Define colour scheme
p.col <- c(rep("red", times = 1), rep("darkred", times = 4), rep("forestgreen", times = 5))
pol.plot1 = strat.plot(ma.pollen_1[,2:11],exag = T, exag.mult = 5, exag.alpha=0.2, yvar = ma.pollen_1$Age, col.poly.line="black", cex.xlabel = 1.2, scale.minmax = T, xSpace=0.015, srt.xlabel = 70, scale.percent=TRUE, y.rev = T, plot.line=T, col.line = p.col, plot.poly=TRUE, plot.bar=F, col.poly=p.col)
#PLOT PLANTS & AQUATICS
ma.pollen_2 = as.data.frame(cbind(as.numeric(ma.pollen$`age`), ma.pollen$Cyperaceae, ma.pollen$Ericaceae, ma.pollen$Myrica, ma.pollen$Lycopodium, ma.pollen$Artemisia, ma.pollen$Poaceae, ma.pollen$Pediastrum, ma.pollen$Nuphar, ma.pollen$Potamogeton))
colnames(ma.pollen_2) = c("Age", "Cyperaceae", "Ericaceae","Myrica", "Lycopodium","Artemisia", "Poaceae", "Pediastrum", "Nuphar", "Potamogeton")
ma.pollen_2 = ma.pollen_2[1:148,]
# Define colour scheme
p.col <- c(rep("gold2", times = 6), rep("blue", times = 3))
pol.plot2 = strat.plot(ma.pollen_2[,2:10], exag = T, exag.mult = 5, exag.alpha=0.2, yvar = ma.pollen_1$Age, col.poly.line="black", cex.xlabel = 1.2, scale.minmax = T, xSpace=0.015, srt.xlabel = 70, scale.percent=TRUE, y.rev = T, plot.line=T, col.line = p.col, plot.poly=TRUE, plot.bar=F, col.poly=p.col)
# POLLEN DIAGRAM (%)
library(rioja)
library(ggplot2)
# Import data
ma.pollen <- read.csv("Pollen_percentages.csv", header=TRUE, sep=";", check.names = FALSE)
txsedim <- read.csv("Sedimentation_rate.csv", header=TRUE, sep=";", check.names = FALSE)
dev.off()
x = pol.plot <- strat.plot(ma.pollen[,4:23], scale.minmax = T, x.pc.inc = 10, yvar=ma.pollen$`Age`, xLeft=0.15, exag.mult=5, y.rev=TRUE, exag = T, col.exag = "auto", exag.alpha=0.2, plot.line=TRUE, plot.poly=T, plot.bar=F, col.poly = "black", lwd.bar=10, sep.bar=TRUE, scale.percent=TRUE, xSpace=0.01, x.pc.lab=TRUE, x.pc.omit0=TRUE, las=2)
x = pol.plot <- strat.plot(ma.pollen[,4:23], scale.minmax = T, x.pc.inc = 10, yvar=ma.pollen$`Depth (cm)`,y.tks = , xLeft=0.15, exag.mult=5, y.rev=TRUE, exag = T, col.exag = "auto", exag.alpha=0.2, plot.line=TRUE, plot.poly=T, plot.bar=F, col.poly = "black", lwd.bar=10, sep.bar=TRUE, scale.percent=TRUE, xSpace=0.01, x.pc.lab=TRUE, x.pc.omit0=TRUE, las=2)
plot(txsedim$`Depth (cm)`, txsedim$nbr_yr, type = "l")
ggplot(txsedim, aes(seq(length=nrow(txsedim)), txsedim$nbr_yr)) + geom_path() + #Ploting
scale_y_continuous(name= "Number of failures") +
scale_x_continuous(name= "Operations performed")
##########################################################################################################################
#Reconstitution Temperatures
##########################################################################################################################
dev.off()
par(mfrow = c(5,1), mar = c(0.3,4,4,1))
##### UPITER ET AL., 2014 (chironomid inferred July temperature) - ncdc.noaa.gov - 2 transfert functions (Barley et al., 2006 & Porinchu et al., 2009)
FStemp<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Upiter_etal.csv",h=T,sep=";")
head(FStemp)
colnames(FStemp) = c("Age", "Temp", "sup", "inf")
smoothingFStemp = smooth.spline(FStemp$Age, FStemp$Temp, spar=0.15)
plot(smoothingFStemp,type="l",xlim=c(10000,-68),ylim=c(7.5,14.5),col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=2,cex.axis=1.3,bty="n", xaxt="n")
FStemp_infSap = smooth.spline(FStemp$Age, FStemp$inf, spar=0.15)
FStemp_supSap = smooth.spline(FStemp$Age, FStemp$sup, spar=0.15)
polygon(c(smoothingFStemp$x, rev(smoothingFStemp$x)), c(FStemp$sup, rev(FStemp$inf)),
col = "aquamarine4", border = NA)
lines(smoothingFStemp, col=c("black"), lwd = 2)
linemeanFStemp<-mean(FStemp$Temp)
abline(a=NULL,b=NULL,h=linemeanFStemp,v=NULL, col = "red", lwd = 2, lty = 2)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
axis(3,at=seq(0,10000,1000), labels=c("0","1","2","3","4","5","6", "7", "8", "9", "10") , lty = 1, lwd = 2, font.axis=2, cex.axis = 2)
##### TEMPERATURE FROM PORTER ET AL., 2019
FStemp2<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Porter_etal.csv",h=T,sep=";")
head(FStemp2)
colnames(FStemp2) = c("Age", "Temp", "sup", "inf")
FStemp2 = subset(FStemp2, FStemp2$Age < 10000)
smoothingFStemp2 = smooth.spline(FStemp2$Age, FStemp2$Temp, spar=0.15)
plot(smoothingFStemp2,type="l",xlim=c(10000,-68),ylim=c(-2,3),col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=2,cex.axis=1.3,bty="n", xaxt="n")
FStemp_infSap2 = smooth.spline(FStemp2$Age, FStemp2$inf, spar=0.15)
FStemp_supSap2 = smooth.spline(FStemp2$Age, FStemp2$sup, spar=0.15)
polygon(c(smoothingFStemp2$x, rev(smoothingFStemp2$x)), c(FStemp2$sup, rev(FStemp2$inf)),
col = "aquamarine4", border = NA)
lines(smoothingFStemp2, col=c("black"), lwd = 2)
abline(a=NULL,b=NULL,h=0,v=NULL, col = "red", lwd = 2, lty = 2)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
##### LECAVALIER ET AL., 2017 - Arctic air temperature reconstruction
FStemp3<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Lecavalier_etal.csv",h=T,sep=";")
head(FStemp3)
colnames(FStemp3) = c("Age", "Temp", "sup", "inf")
head(FStemp3)
FStemp3 = subset(FStemp3, FStemp3$Age < 10000)
smoothingFStemp3 = smooth.spline(FStemp3$Age, FStemp3$Temp, spar=0.15)
plot(smoothingFStemp3,type="l",xlim=c(10000,-68),ylim=c(-2,8),col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=2,cex.axis=1.3,bty="n", xaxt="n")
FStemp_infSap3 = smooth.spline(FStemp3$Age, FStemp3$inf, spar=0.15)
FStemp_supSap3 = smooth.spline(FStemp3$Age, FStemp3$sup, spar=0.15)
polygon(c(smoothingFStemp3$x, rev(smoothingFStemp3$x)), c(FStemp3$sup, rev(FStemp3$inf)),
col = "aquamarine4", border = NA)
lines(smoothingFStemp3, col=c("black"), lwd = 2)
linemeanFStemp3<-mean(FStemp3$Temp)
abline(a=NULL,b=NULL,h=linemeanFStemp3,v=NULL, col = "red", lwd = 2, lty = 2)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
##### VIAU ET AL. 2006
FStemp5<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Viau_etal.csv",h=T,sep=";")
head(FStemp5)
colnames(FStemp5) = c("Age", "Temp")
FStemp5 = subset(FStemp5, FStemp5$Age < 10000)
head(FStemp5)
smoothingFStemp5 = smooth.spline(FStemp5$Age, FStemp5$Temp, spar=0.15)
plot(smoothingFStemp5,type="l",xlim=c(10000,-68),ylim=c(7,9),col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=2,cex.axis=1.5,bty="n", xaxt="n")
linemeanFStemp5<-mean(FStemp5$Temp)
abline(a=NULL,b=NULL,h=linemeanFStemp5,v=NULL, col = "red", lwd = 2, lty = 2)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
##SCALING
par(mfrow = c(5,1), mar = c(0.2,2,2,0.7), oma = c(1, 0.1, 0, 0.5))
FStemp1 = FStemp[,1:2]
approxtemp1 <-approx(FStemp1$Age,FStemp1$Temp ,method="linear",xout=seq(-68,6000,by=1), rule = 2)
approxtemp1$y = scale(approxtemp1$y, scale = T, center = T)
plot(approxtemp1$y, type = "l")
mean(approxtemp1$y)
sd(approxtemp1$y)
FStemp2 = FStemp2[,1:2]
approxtemp2 <-approx(FStemp2$Age,FStemp2$Temp ,method="linear",xout=seq(-68,10000,by=1), rule = 2)
approxtemp2$y = scale(approxtemp2$y, scale = T, center = T)
plot(approxtemp2$y, type = "l")
mean(approxtemp2$y)
sd(approxtemp2$y)
FStemp3 = FStemp3[,1:2]
approxtemp3 <-approx(FStemp3$Age,FStemp3$Temp ,method="linear",xout=seq(-68,10000,by=1), rule = 2)
approxtemp3$y = scale(approxtemp3$y, scale = T, center = T)
plot(approxtemp3$y, type = "l")
mean(approxtemp3$y)
sd(approxtemp3$y)
FStemp5 = FStemp5[,1:2]
approxtemp5 <-approx(FStemp5$Age,FStemp5$Temp ,method="linear",xout=seq(-68,10000,by=1), rule = 2)
approxtemp5$y = scale(approxtemp5$y, scale = T, center = T)
plot(approxtemp5$y, type = "l")
mean(approxtemp5$y)
sd(approxtemp5$y)
#write.csv(approxtemp1,file="E:/Sauvegarde_24052020/2-En_cours/AXE_2_FEUX_PASSES/DATA_climat/TEMP1.csv",row.names = FALSE)
#write.csv(approxtemp2,file="E:/Sauvegarde_24052020/2-En_cours/AXE_2_FEUX_PASSES/DATA_climat/TEMP2.csv",row.names = FALSE)
#write.csv(approxtemp3,file="E:/Sauvegarde_24052020/2-En_cours/AXE_2_FEUX_PASSES/DATA_climat/TEMP3.csv",row.names = FALSE)
#write.csv(approxtemp4,file="E:/Sauvegarde_24052020/2-En_cours/AXE_2_FEUX_PASSES/DATA_climat/TEMP4.csv",row.names = FALSE)
#write.csv(approxtemp5,file="F:/1-THESE/AXE_2_FEUX_PASSES/DATA_climat/TEMP5.csv",row.names = FALSE)
#Import pooled data (scaled)
dev.off()
#File with substraction between each subsample and mean of the reference period
TEMP <- read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Temperature_anomalies_0_500.csv", row.names = 1, header=TRUE, sep=";", check.names=F)
#write.csv(TEMP,file="F:/1-THESE/2-En_cours/AXE_2_FEUX_PASSES/DATA_climat/Mean_temp_scaled2.csv",row.names = FALSE)
plot(rev(TEMP$MEAN),type="l",col=c("black"),ylab = " ", axes=F, font.axis=2, lwd=1,cex.axis=1.3,bty="n", xaxt="n")
linemean<-mean(TEMP$MEAN[69:569])
abline(a=NULL,b=NULL,h=linemean,v=NULL, col = "red", lwd = 2, lty = 2)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.5, las = 1)
axis(3,at=seq(0,10000,1000), labels=c("10","9","8","7","6","5","4", "3","2", "1", "0") , lty = 1, lwd = 2, font.axis=2, cex.axis = 2)
#Bootstrap around scaled temperature
library(boot)
dev.off()
head(TEMP)
TempSap<-TEMP[,1:4]
tempSap_plot<-TempSap[,c("TEMP1","TEMP2","TEMP3", "TEMP5")]
my.data<-as.data.frame(t(tempSap_plot))
R<-999
l=length(my.data[1,])
bootCI<-as.data.frame(matrix(ncol=3,nrow=l))
boot.mean<-function(y,m)
{z<-mean(y[m])
z}
for(i in 1:l) {
y<-my.data[,i]
y<-na.omit(y)
boot.obj<-boot(y,boot.mean,R)
IC.norm<-boot.ci(boot.obj,conf=0.90,type="norm")
bootCI[i,]<-IC.norm$normal
}
#Add Interval Confidence in first dataframe
tempBootCISap<-cbind(as.numeric(rownames(TempSap)), TEMP$MEAN, bootCI)
colnames(tempBootCISap)=c("Age","Mean","CI","Infe","Supe")
moyenne = mean((tempBootCISap$Mean[69:569]))
summary(tempBootCISap)
Tempmean_smoothSap = tempBootCISap[,1:2]
Tempmean_smoothSap = smooth.spline(tempBootCISap$Mean, spar=0.15) #Tu smooth tes données
#Plot TEMP and Interval of Confidence
par(mfrow = c(1,1), mar = c(4,4,4,4))
plot(Tempmean_smoothSap$x, Tempmean_smoothSap$y,type="l",xlim=c(10000,-68),ylim=c(-3,4),col=c("black"), axes=F, font.axis=2, xlab = " ", ylab = " ", cex.axis=0.8, lty=1, bty="n", lwd = 2, xaxt="n")
Tempmean_infSap = smooth.spline(tempBootCISap$Age, tempBootCISap$Infe, spar=0.15)
Tempmean_supSap = smooth.spline(tempBootCISap$Age, tempBootCISap$Supe, spar=0.15)
polygon(c(Tempmean_smoothSap$x,rev(Tempmean_smoothSap$x)),c(Tempmean_supSap$y,rev(Tempmean_infSap$y)),col="yellow2", border = NA)
lines(Tempmean_smoothSap, col=c("red"), lwd = 3)
linemeanTemp<-moyenne
abline(a=NULL,b=NULL,h=linemeanTemp,v=NULL, col = "black", lwd = 1, lty = 1)
axis(2, at=NULL, labels=TRUE, lty = 1, lwd = 2, font.axis=2, cex.axis = 1.3, las = 1, col = "black")
axis(3,at=c(-68,0,1000,2000,3000,4000,5000,6000,7000,8000,9000,10000), lty = 1, lwd = 2, font.axis=2, cex.axis = 1.3)
#PROCESS CORRELATIONS BINCOR
rm(list = ls()) # Deleting variables from the environment R
dev.off()
library(BINCOR)
library(pracma)
#Data_feu
firemetrics<-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Fire_history/firemetrics.csv",h=T,sep=",")
#Data climat
climat <-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Temperature_data/Temperature_anomalies_0_500.csv",h=T,sep=";")
#Data pollen (PAR)
pollen <-read.csv("F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/Vegetation_history/Pollen_influx.csv",h=T,sep=";")
# Correlations
###TEMP et fire metrics
RegFF = cbind(firemetrics$Age[1:9599], firemetrics$RegFF[1:9599])
RegBB = cbind(firemetrics$Age[1:9599], firemetrics$RegBB[1:9599])
FS = cbind(firemetrics$Age[1:9599], firemetrics$FSindex[1:9599])
TEMP = cbind(climat$ï..AGE, climat$MEAN)
PAR = cbind(pollen$ï..age, pollen$PAR)
Picea = cbind(pollen$ï..age, pollen$Picea)
Betula = cbind(pollen$ï..age, pollen$Betula)
Alnus.c = cbind(pollen$ï..age, pollen$Alnus.crispa)
Alnus.r = cbind(pollen$ï..age, pollen$Alnus.rugosa)
Pinus = cbind(pollen$ï..age, pollen$Pinus)
Juniperus = cbind(pollen$ï..age, pollen$Juniperus)
Populus = cbind(pollen$ï..age, pollen$Populus)
Myrica = cbind(pollen$ï..age, pollen$Myrica)
Poaceae = cbind(pollen$ï..age, pollen$Poaceae)
Salix = cbind(pollen$ï..age, pollen$Salix)
Larix = cbind(pollen$ï..age, pollen$Larix)
Lycopodium = cbind(pollen$ï..age, pollen$Lycopodium)
Artemisia = cbind(pollen$ï..age, pollen$Artemisia)
Cyperaceae = cbind(pollen$ï..age, pollen$Cyperaceae)
Ericaceae = cbind(pollen$ï..age, pollen$Ericaceae)
Nuphar = cbind(pollen$ï..age, pollen$Nuphar)
Pediastrum = cbind(pollen$ï..age, pollen$Pediastrum)
Potamogeton = cbind(pollen$ï..age, pollen$Potamogeton)
# REGFF
test1 = bin_cor(RegFF, TEMP, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_RegFF")
binnedts<- test1$Binned_time_series
bin_ts1 <- na.omit(test1$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test1$Binned_time_series[,c(1,3)])
plot_ts(RegFF, TEMP, bin_ts1, bin_ts2, "RegFF", "TEMP", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test2 = bin_cor(RegBB, TEMP, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_RegBB")
binnedts <- test2$Binned_time_series
bin_ts1 <- na.omit(test2$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test2$Binned_time_series[,c(1,3)])
plot_ts(RegBB, TEMP, bin_ts1, bin_ts2, "RegBB", "TEMP", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test3 = bin_cor(FS, TEMP, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_FS")
binnedts <- test3$Binned_time_series
bin_ts1 <- na.omit(test3$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test3$Binned_time_series[,c(1,3)])
plot_ts(FS, TEMP, bin_ts1, bin_ts2, "FS", "TEMP", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
###Pollen et fire metrics
test4 = bin_cor(RegFF, PAR, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_PAR")
binnedts <- test4$Binned_time_series
bin_ts1 <- na.omit(test4$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test4$Binned_time_series[,c(1,3)])
plot_ts(RegFF, PAR, bin_ts1, bin_ts2, "RegFF", "PAR", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test5 = bin_cor(RegBB, PAR, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_PAR")
binnedts <- test5$Binned_time_series
bin_ts1 <- na.omit(test5$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test5$Binned_time_series[,c(1,3)])
plot_ts(RegBB, PAR, bin_ts1, bin_ts2, "RegBB", "PAR", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test6 = bin_cor(FS, PAR, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_PAR")
binnedts <- test6$Binned_time_series
bin_ts1 <- na.omit(test6$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test6$Binned_time_series[,c(1,3)])
plot_ts(FS, PAR, bin_ts1, bin_ts2, "FS", "PAR", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
#Species
test7 = bin_cor(RegFF, Picea, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Picea")
binnedts <- test7$Binned_time_series
bin_ts1 <- na.omit(test7$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test7$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Picea, bin_ts1, bin_ts2, "RegFF", "Picea", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test8 = bin_cor(RegBB, Picea, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Picea")
binnedts <- test8$Binned_time_series
bin_ts1 <- na.omit(test8$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test8$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Picea, bin_ts1, bin_ts2, "RegBB", "Picea", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(FS, Picea, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_picea")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(FS, Picea, bin_ts1, bin_ts2, "FS", "Picea", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Picea, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_picea")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Picea, bin_ts1, bin_ts2, "TEMP", "Picea", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test10 = bin_cor(RegFF, Pinus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Pinus")
binnedts <- test10$Binned_time_series
bin_ts1 <- na.omit(test10$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test10$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Pinus, bin_ts1, bin_ts2, "RegFF", "Pinus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test11 = bin_cor(RegBB, Pinus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Pinus")
binnedts <- test11$Binned_time_series
bin_ts1 <- na.omit(test11$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test11$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Pinus, bin_ts1, bin_ts2, "RegBB", "Pinus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test12 = bin_cor(FS, Pinus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Pinus")
binnedts <- test12$Binned_time_series
bin_ts1 <- na.omit(test12$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test12$Binned_time_series[,c(1,3)])
plot_ts(FS, Pinus, bin_ts1, bin_ts2, "FS", "Pinus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Pinus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_Pinus")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Pinus, bin_ts1, bin_ts2, "TEMP", "Pinus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test13 = bin_cor(RegFF, Betula, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Betula")
binnedts <- test13$Binned_time_series
bin_ts1 <- na.omit(test13$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test13$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Pinus, bin_ts1, bin_ts2, "RegFF", "Betula", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test14 = bin_cor(RegBB, Betula, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Betula")
binnedts <- test14$Binned_time_series
bin_ts1 <- na.omit(test14$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test14$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Pinus, bin_ts1, bin_ts2, "RegBB", "Betula", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test15 = bin_cor(FS, Betula, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Betula")
binnedts <- test15$Binned_time_series
bin_ts1 <- na.omit(test15$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test15$Binned_time_series[,c(1,3)])
plot_ts(FS, Pinus, bin_ts1, bin_ts2, "FS", "Betula", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Betula, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_betula")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Betula, bin_ts1, bin_ts2, "TEMP", "Betula", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test16 = bin_cor(RegFF, Alnus.c, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Alnusc")
binnedts <- test16$Binned_time_series
bin_ts1 <- na.omit(test16$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test16$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Pinus, bin_ts1, bin_ts2, "RegFF", "Alnusc", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test17 = bin_cor(RegBB, Alnus.c, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Alnusc")
binnedts <- test17$Binned_time_series
bin_ts1 <- na.omit(test17$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test17$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Pinus, bin_ts1, bin_ts2, "RegBB", "Alnusc", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test18 = bin_cor(FS, Alnus.c, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Alnusc")
binnedts <- test18$Binned_time_series
bin_ts1 <- na.omit(test18$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test18$Binned_time_series[,c(1,3)])
plot_ts(FS, Pinus, bin_ts1, bin_ts2, "FS", "Alnusc", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Alnus.c, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_TEMP_Alnusc")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Alnus.c, bin_ts1, bin_ts2, "TEMP", "Alnusc", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test19 = bin_cor(RegFF, Juniperus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_juniperus")
binnedts <- test19$Binned_time_series
bin_ts1 <- na.omit(test19$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test19$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Juniperus, bin_ts1, bin_ts2, "RegFF", "Juniperus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test20 = bin_cor(RegBB, Juniperus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Juniperus")
binnedts <- test20$Binned_time_series
bin_ts1 <- na.omit(test20$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test20$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Juniperus, bin_ts1, bin_ts2, "RegBB", "Juniperus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test21 = bin_cor(FS, Juniperus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Juniperus")
binnedts <- test21$Binned_time_series
bin_ts1 <- na.omit(test21$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test21$Binned_time_series[,c(1,3)])
plot_ts(FS, Juniperus, bin_ts1, bin_ts2, "FS", "Juniperus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Juniperus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_Juniperus")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Juniperus, bin_ts1, bin_ts2, "TEMP", "Juniperus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test22 = bin_cor(RegFF, Populus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Populus")
binnedts <- test22$Binned_time_series
bin_ts1 <- na.omit(test22$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test22$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Populus, bin_ts1, bin_ts2, "RegFF", "Populus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test23 = bin_cor(RegBB, Populus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Populus")
binnedts <- test23$Binned_time_series
bin_ts1 <- na.omit(test23$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test23$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Populus, bin_ts1, bin_ts2, "RegBB", "Populus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test24 = bin_cor(FS, Populus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_populus")
binnedts <- test24$Binned_time_series
bin_ts1 <- na.omit(test24$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test24$Binned_time_series[,c(1,3)])
plot_ts(FS, Populus, bin_ts1, bin_ts2, "FS", "Populus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Populus, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_populus")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Populus, bin_ts1, bin_ts2, "TEMP", "Populus", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test25 = bin_cor(RegFF, Myrica, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Myrica")
binnedts <- test25$Binned_time_series
bin_ts1 <- na.omit(test25$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test25$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Myrica, bin_ts1, bin_ts2, "RegFF", "Myrica", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test26 = bin_cor(RegBB, Myrica, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Myrica")
binnedts <- test26$Binned_time_series
bin_ts1 <- na.omit(test26$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test26$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Myrica, bin_ts1, bin_ts2, "RegBB", "Myrica", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test27 = bin_cor(FS, Myrica, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Myrica")
binnedts <- test27$Binned_time_series
bin_ts1 <- na.omit(test27$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test27$Binned_time_series[,c(1,3)])
plot_ts(FS, Myrica, bin_ts1, bin_ts2, "FS", "Myrica", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Myrica, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_TEMP_Myrica")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Myrica, bin_ts1, bin_ts2, "TEMP", "Myrica", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test28 = bin_cor(RegFF, Lycopodium, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Lycopodium")
binnedts <- test28$Binned_time_series
bin_ts1 <- na.omit(test28$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test28$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Lycopodium, bin_ts1, bin_ts2, "RegFF", "Lycopodium", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test29 = bin_cor(RegBB, Lycopodium, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Lycopodium")
binnedts <- test29$Binned_time_series
bin_ts1 <- na.omit(test29$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test29$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Lycopodium, bin_ts1, bin_ts2, "RegBB", "Lycopodium", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test30 = bin_cor(FS, Lycopodium, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Lycopodium")
binnedts <- test30$Binned_time_series
bin_ts1 <- na.omit(test30$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test30$Binned_time_series[,c(1,3)])
plot_ts(FS, Lycopodium, bin_ts1, bin_ts2, "FS", "Lycopodium", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Lycopodium, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_lycopodium")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Lycopodium, bin_ts1, bin_ts2, "TEMP", "Lycopodium", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test31 = bin_cor(RegFF, Salix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Salix")
binnedts <- test31$Binned_time_series
bin_ts1 <- na.omit(test31$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test31$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Salix, bin_ts1, bin_ts2, "RegFF", "Salix", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test32 = bin_cor(RegBB, Salix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Salix")
binnedts <- test32$Binned_time_series
bin_ts1 <- na.omit(test32$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test32$Binned_time_series[,c(1,3)])
plot_ts(RegBB, Salix, bin_ts1, bin_ts2, "RegBB", "Salix", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test33 = bin_cor(FS, Salix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_FS_Salix")
binnedts <- test33$Binned_time_series
bin_ts1 <- na.omit(test33$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test33$Binned_time_series[,c(1,3)])
plot_ts(FS, Salix, bin_ts1, bin_ts2, "FS", "Salix", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test9 = bin_cor(TEMP, Salix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_temp_salix")
binnedts <- test9$Binned_time_series
bin_ts1 <- na.omit(test9$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test9$Binned_time_series[,c(1,3)])
plot_ts(TEMP, Salix, bin_ts1, bin_ts2, "TEMP", "Salix", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test34 = bin_cor(RegFF, Larix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegFF_Larix")
binnedts <- test34$Binned_time_series
bin_ts1 <- na.omit(test34$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test34$Binned_time_series[,c(1,3)])
plot_ts(RegFF, Larix, bin_ts1, bin_ts2, "RegFF", "Larix", colts1=1, colts2=2, colbints1=3, colbints2=4, device="screen")
cor_ts(bin_ts1, bin_ts2, rmltrd="n", KoCM="pearson")
test35 = bin_cor(RegBB, Larix, FLAGTAU=3, ofilename="F:/1-THESE/AXE_2_FEUX_PASSES/Github/Research-data-master/tmp/ccf_RegBB_Larix")
binnedts <- test35$Binned_time_series
bin_ts1 <- na.omit(test35$Binned_time_series[,1:2])
bin_ts2 <- na.omit(test35$Binned_time_series[,c(1,3)])