-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathLesson_7.R
59 lines (41 loc) · 1.71 KB
/
Lesson_7.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
library(chillR)
?Chilling_Hours
Chilling_Hours
Chilling_Hours(Winters_hours_gaps$Temp,summ=FALSE)
Utah_Model
Utah_Model
function(HourTemp,summ=TRUE)
return(step_model(HourTemp,
df=data.frame(lower=c(-1000,1.4,2.4,9.1,12.4,15.9,18),
upper=c(1.4,2.4,9.1,12.4,15.9,18,1000),
weight=c(0,0.5,1,0.5,0,-0.5,-1)),
summ=summ))
data.frame(lower=c(-1000,1.4,2.4,9.1,12.4,15.9,18),
upper=c(1.4,2.4,9.1,12.4,15.9,18,1000),
weight=c(0,0.5,1,0.5,0,-0.5,-1))
plot(step_model(Winters_hours_gaps$Temp,
df=data.frame(lower=c(-1000,1.4,2.4,9.1,12.4,15.9,18),
upper=c(1.4,2.4,9.1,12.4,15.9,18,1000),
weight=c(0,0.5,1,0.5,0,-0.5,-1))))
Utah_Model(Winters_hours_gaps$Temp,summ=TRUE)
newFrame<-data.frame(lower=c(-1000,-5,2.4,9.1,12.4,15.9,18),
upper=c(-5,2.4,9.1,12.4,15.9,18,1000),
weight=c(0,10,1,0.5,0,-0.5,-1))
myModel<-function(HourTemps,summ=TRUE)
{step_model(HourTemps,
df=newFrame,
summ=summ)
}
myModel(Winters_hours_gaps$Temp)
Dynamic_Model(Winters_hours_gaps$Temp)[nrow(Winters_hours_gaps)]
chilling
chilling(make_JDay(Winters_hours_gaps))
chilling(make_JDay(Winters_hours_gaps),Start_JDay = 100,End_JDay = 200)
tempResponse(make_JDay(Winters_hours_gaps),
Start_JDay = 100,
End_JDay = 200,
models = list(Chilling_Hours = Chilling_Hours,
Utah_Chill_Units = Utah_Model,
Chill_Portions = Dynamic_Model,
GDH = GDH,
myModel = myModel))