-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprep_model_testing_tab.R
92 lines (60 loc) · 2.89 KB
/
prep_model_testing_tab.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
library(ggplot2)
library(RColorBrewer)
library(plyr)
### setwd()
wd <- setwd("C:/Users/iotte/Desktop/III_isoIntensive")
iso <- read.csv2("iso_test_traject.csv", sep = ";")
dex.humid <- subset(iso, iso$d.excess <= 10)
dex.humid.pos <- subset(dex.humid, dex.humid$d.excess >= 0)
dex.humid.pos.O18 <- aggregate(dex.humid.pos$d18_16,
by = list(dex.humid.pos$plot_id_sp1),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.O18) <- c("plot_id_sp1", "O18")
dex.humid.pos.H2 <- aggregate(dex.humid.pos$dD_H,
by = list(dex.humid.pos$plot_id_sp1),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.H2) <- c("plot_id_sp1", "H2")
dex.humid.pos.dex <- aggregate(dex.humid.pos$d.excess,
by = list(dex.humid.pos$plot_id_sp1),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.dex) <- c("plot_id_sp1", "d.excess")
dex.humid.iso <- cbind(dex.humid.pos.O18, dex.humid.pos.H2, dex.humid.pos.dex)
dex.humid.iso <- dex.humid.iso[, -(3)]
dex.humid.iso <- dex.humid.iso[, -(4)]
################
################
###### iso long term
###############
iso <- read.csv2("iso_calc.csv", sep = ";")
dex.humid <- subset(iso, iso$d.excess <= 10)
dex.humid.pos <- subset(dex.humid, dex.humid$d.excess >= 0)
dex.humid.pos.O18 <- aggregate(dex.humid.pos$d18_16,
by = list(dex.humid.pos$plot_id_sp1, dex.humid.pos$type),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.O18) <- c("plot_id_sp1", "type", "O18")
dex.humid.pos.H2 <- aggregate(dex.humid.pos$dD_H,
by = list(dex.humid.pos$plot_id_sp1, dex.humid.pos$type),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.H2) <- c("plot_id_sp1", "type", "H2")
dex.humid.pos.dex <- aggregate(dex.humid.pos$d.excess,
by = list(dex.humid.pos$plot_id_sp1, dex.humid.pos$type),
na.rm = TRUE,
FUN = "mean")
colnames(dex.humid.pos.dex) <- c("plot_id_sp1", "type", "d.excess")
dex.humid.iso.lgt.type <- cbind(dex.humid.pos.O18, dex.humid.pos.H2, dex.humid.pos.dex)
dex.humid.iso.lgt.type <- dex.humid.iso.lgt.type[, -(4:5)]
dex.humid.iso.lgt.type <- dex.humid.iso.lgt.type[, -(5:6)]
#### now do it
shit <- read.csv2("iso_test_traject_hmd_KiLiType.csv", sep = ";")
shit$mnth <- substr(shit$date_sample, 6, 7)
shit.dec <- subset(shit, shit$mnth == "12")
shit.apr <- subset(shit, shit$mnth == "04")
temp <- aggregate(shit.apr$FcKili,
by = list(shit.apr$plot_id_sp1, shit.apr$type),
na.rm = TRUE,
FUN = "mean")