-
Notifications
You must be signed in to change notification settings - Fork 0
/
BW_tbl_komp.R
60 lines (59 loc) · 2.04 KB
/
BW_tbl_komp.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
load("BW_17_stationen.RData")
summary(BW_station_data)
station_names <-names(BW_station_data)
BW_station_data[[stnm]]$NO_
BW_stations_NO2_tbl <- tibble()
for (stnm in station_names) {
if (NROW (BW_station_data[[stnm]]$NO2)> 1){
df <- BW_station_data[[stnm]]$NO2
BW_stations_NO2_tbl <- bind_rows(BW_stations_NO2_tbl,df)
}
}
head(BW_stations_NO2_tbl)
NROW(BW_stations_NO2_tbl) #[1] 2385207
# NO hinzufügen
BW_stations_NO_tbl <- tibble()
for (stnm in station_names) {
if (NROW (BW_station_data[[stnm]]$NO_)> 1){
df <- BW_station_data[[stnm]]$NO_
BW_stations_NO_tbl <- bind_rows(BW_stations_NO_tbl,df)
}
}
NROW(BW_stations_NO_tbl)#2304904
BW_stations_komp <-inner_join(BW_stations_NO2_tbl,BW_stations_NO_tbl, by = c("station","datetime","name"))
# O3 hinzufügen
BW_stations_O3_tbl <- tibble()
for (stnm in station_names) {
if (NROW (BW_station_data[[stnm]]$O3)> 1){
df <- BW_station_data[[stnm]]$O3
BW_stations_O3_tbl <- bind_rows(BW_stations_O3_tbl,df)
}
}
NROW(BW_stations_O3_tbl)#1703734
BW_stations_komp <-inner_join(BW_stations_komp,BW_stations_O3_tbl, by = c("station","datetime","name"))
# Temp hinzufügen
BW_stations_Temp_tbl <- tibble()
for (stnm in station_names) {
if (NROW (BW_station_data[[stnm]]$Temp)> 1){
df <- BW_station_data[[stnm]]$Temp
df$Temp <- as.numeric(df$Temp)
BW_stations_Temp_tbl <- bind_rows(BW_stations_Temp_tbl,df)
}
}
BW_stations_komp <-inner_join(BW_stations_komp,BW_stations_Temp_tbl, by = c("station","datetime","name"))
BW_stations_komp$name <- as_factor(BW_stations_komp$name)
summary(BW_stations_komp)
# WG hinzufügen
BW_stations_WG_tbl <- tibble()
for (stnm in station_names) {
if (NROW (BW_station_data[[stnm]]$WG)> 1){
df <- BW_station_data[[stnm]]$WG
df$WG <- as.numeric(df$WG)
BW_stations_WG_tbl <- bind_rows(BW_stations_WG_tbl,df)
}
}
BW_stations_WG_tbl$name <- as_factor(BW_stations_WG_tbl$name)
BW_stations_komp_WG <- inner_join(BW_stations_komp,BW_stations_WG_tbl)
levels(BW_stations_komp_WG$name)
save(BW_stations_komp, file = "BW_stations_komp.RData")
save(BW_stations_komp_WG, file = "BW_stations_komp_WG.RData")