forked from mishahublog/BioArgo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBioArgo range finder.R
63 lines (43 loc) · 1.59 KB
/
BioArgo range finder.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
#======================================
#BioArgo tool Box
#=======================================
#Find ranges of different types of parameters from BioArgo
#Find range
bioArgo_Ranger<- function(batchlist,parameter){
if(parameter=="latitude"){
r<-range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$latitude))))
return(r)
}
if(parameter=="longitude"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$longitude))))
return(r)
}
if(parameter=="cyclono"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$cycle.no))))
return(r)
}
if(parameter=="date"){
r<- range(ldply(lapply(1:length(batchlist),function(x)x<- as.Date(unique(batchlist[[x]]$Date),origin="1950-01-01")[1]))[,1])
return(r)
}
if(parameter=="pressure"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$pressure))))
return(r)
}
if(parameter=="temperature"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$temperature))))
return(r)
}
if(parameter=="salinity"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$salinity))))
return(r)
}
if(parameter=="oxygen"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$oxygen))))
return(r)
}
if(parameter=="chlorophyll"){
r<- range(lapply(1:length(batchlist),function(x)as.numeric(unique(batchlist[[x]]$chlorophyll))))
return(r)
}
}