-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpot_analysis.R
More file actions
212 lines (146 loc) · 6.11 KB
/
Copy pathpot_analysis.R
File metadata and controls
212 lines (146 loc) · 6.11 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
199
200
201
202
203
204
205
206
207
208
209
210
211
library(readxl)
MeasureCampaign = Measurement_Campaign
MeasureCampaign
#
C_Humidity_1<- mean(c(33.37, 31.13, 15.37))
C_Humidity_1
T_Humidity_1<- mean(c(33.83, 23.53, 32.23))
T_Humidity_1
C_Humidity_2<-mean(c(27.17, 33.70, 23.3))
C_Humidity_2
T_Humidity_2<-mean(as.numeric(unlist(c(MeasureCampaign[c(16,17,18), 7])[1])))
T_Humidity_2
C_Humidity_3<-mean(c(24.5, 24.4, 19.7))
C_Humidity_3
T_Humidity_3<- mean(c(13.33, 16.53, 8.73))
T_Humidity_3
dif1<- T_Humidity_1 - C_Humidity_1
dif2<- T_Humidity_2 - C_Humidity_2
dif3<- T_Humidity_3 - C_Humidity_3
dif1
dif2
dif3
### plot environmental
### ajouter une importation excel depuis FunEco
# pour raccourcir le nom
data <- FunEco_OUTSIDE
# prend l'horodatage des trois périodes de 24h précédent les mesures de terrain
dates_1 <- c(data[ (293:340),1])
dates_2 <- c(data[ (1301:1348),1])
dates_3 <- c(data[ (1973:2020),1])
#time <- c(12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5)
time <- seq(0,23.5,0.5)
# donnees d'ensoleillement
sun_1 <- as.numeric(unlist(c(data[ (293:340),2])))
sun_2 <- as.numeric(unlist(c(data[ (1301:1348),2])))
sun_3 <- as.numeric(unlist(c(data[ (1973:2020),2])))
# donnees d'humidite de l'air
hum_1 <- as.numeric(unlist(c(data[ (293:340),3])))
hum_2 <- as.numeric(unlist(c(data[ (1301:1348),3])))
hum_3 <- as.numeric(unlist(c(data[ (1973:2020),3])))
# donnees de temperature de l'air
temp_1 <- as.numeric(unlist(c(data[ (293:340),4])))
temp_2 <- as.numeric(unlist(c(data[ (1301:1348),4])))
temp_3 <- as.numeric(unlist(c(data[ (1973:2020),4])))
# donnees de precipitation
precip_1 <- as.numeric(unlist(c(data[ (293:340),5])))
precip_2 <- as.numeric(unlist(c(data[ (1301:1348),5])))
precip_3 <- as.numeric(unlist(c(data[ (1973:2020),5])))
### plot first time
## set up some fake test data
#time <- c(12, 12.5, 13, 13.5, 14, 14.5, 15, 15.5, 16, 16.5, 17, 17.5, 18, 18.5, 19, 19.5, 20, 20.5, 21, 21.5, 22, 22.5, 23, 23.5, 0, 0.5, 1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11, 11.5)
#sun_1 <- c(data[ (293:341),2])
#temp_1 <- c(data[ (293:341),4])
## add extra space to right margin of plot within frame
par(mar=c(5, 4, 4, 6) + 0.1)
## Plot first set of data and draw its axis
plot(time, sun_1, pch=16, axes=FALSE, ylim=c(0,4000), xlab="", ylab="",
type="l",col="black", main="1st Campaign")
axis(2, ylim=c(0,1),col="black",las=1) ## las=1 makes horizontal labels
mtext("PAR (µmol/m^2/s)",side=2,line=2.5)
box()
## Allow a second plot on the same graph
par(new=TRUE)
## Plot the second plot and put axis scale on right
plot(time, temp_1, pch=15, xlab="", ylab="", ylim=c(0,30),
axes=FALSE, type="l", col="red")
## a little farther out (line=4) to make room for labels
mtext("Temperature",side=4,col="red",line=4)
axis(4, ylim=c(0,30), col="red",col.axis="red",las=1)
## Draw the time axis
axis(1,pretty(range(time),10))
mtext("Time (Hours)",side=1,col="black",line=2.5)
## Add Legend
legend("topleft",legend=c("Light Intensity","Temperature Evolution"),
text.col=c("black","red"),pch=c(16,15),col=c("black","red"))
### plot second time
## add extra space to right margin of plot within frame
par(mar=c(5, 4, 4, 6) + 0.1)
## Plot first set of data and draw its axis
plot(time, sun_2, pch=16, axes=FALSE, ylim=c(0,4000), xlab="", ylab="",
type="l",col="black", main="2nd Campaign")
axis(2, ylim=c(0,1),col="black",las=1) ## las=1 makes horizontal labels
mtext("PAR (µmol/m^2/s)",side=2,line=2.5)
box()
## Allow a second plot on the same graph
par(new=TRUE)
## Plot the second plot and put axis scale on right
plot(time, temp_2, pch=15, xlab="", ylab="", ylim=c(0,30),
axes=FALSE, type="l", col="red")
## a little farther out (line=4) to make room for labels
mtext("Temperature",side=4,col="red",line=4)
axis(4, ylim=c(0,30), col="red",col.axis="red",las=1)
## Draw the time axis
axis(1,pretty(range(time),10))
mtext("Time (Hours)",side=1,col="black",line=2.5)
## Add Legend
legend("topleft",legend=c("Light Intensity","Temperature"),
text.col=c("black","red"),pch=c(16,15),col=c("black","red"))
### rd plot
## add extra space to right margin of plot within frame
par(mar=c(5, 4, 4, 6) + 0.1)
## Plot first set of data and draw its axis
plot(time, sun_3, pch=16, axes=FALSE, ylim=c(0,4000), xlab="", ylab="",
type="l",col="black", main="3rd Campaign")
axis(2, ylim=c(0,1),col="black",las=1) ## las=1 makes horizontal labels
mtext("PAR (µmol/m^2/s)",side=2,line=2.5)
box()
## Allow a second plot on the same graph
par(new=TRUE)
## Plot the second plot and put axis scale on right
plot(time, temp_3, pch=15, xlab="", ylab="", ylim=c(0,30),
axes=FALSE, type="l", col="red")
## a little farther out (line=4) to make room for labels
mtext("Temperature",side=4,col="red",line=4)
axis(4, ylim=c(0,30), col="red",col.axis="red",las=1)
## Draw the time axis
axis(1,pretty(range(time),10))
mtext("Time (Hours)",side=1,col="black",line=2.5)
## Add Legend
legend("topleft",legend=c("Light Intensity","Temperature"),
text.col=c("black","red"),pch=c(16,15),col=c("black","red"))
## Allow a third plot on the same graph
par(new=TRUE)
plot(time, dif3, pch=15, xlab="", ylab="", ylim=c(0,1),
axes=FALSE, type="p", col="red")
### Leaf area extraction¨
data = read_excel("data_masse_and_area.xlsx")
# Control PC leaf area [cm^2]
C1_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 4])[1]))
C2_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 8])[1]))
C3_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 12])[1]))
# Test PC leaf area [cm^2]
T1_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 16])[1]))
T2_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 20])[1]))
T3_PC_leaf_area<-as.numeric(unlist(c(data[c(3,4,5,6,7), 24])[1]))
leaf_area_vect <- c(C1_PC_leaf_area,C2_PC_leaf_area,C3_PC_leaf_area,T1_PC_leaf_area,T2_PC_leaf_area,T3_PC_leaf_area)
Types <- c("Control")
for (i in 1:14){
Types <- c(Types,"Control")
}
for (i in 1:15{
Types <- c(Types, "Test")
}
Types
df_leaf_area <- data.frame(C_leaf_area,Types)
df_leaf_area