12 #new additions only for PQV_2014
13 #TODO: default behavior on station != PQV_2014 ?
16 "GAM_highPollution", #13
17 "GAM_lowPollution", #14
18 "GAM_hotTemperature", #15
19 "GAM_coldTemperature", #16
48 #' @title Get forecasts + observations
50 #' @description Get forecasts of all specified experts for all specified stations, also with (ordered) dates and (unordered) stations indices.
52 #' @param experts Names of the experts. Default: all
53 #' @param station Names of the stations. Default: all
56 getData = function(experts=expertsArray, stations=stationsArray)
58 #no need because of "LazyData: true" in DESCRIPTION
59 #data(list=stations, package="aggexp")
60 data = as.data.frame(matrix(nrow=0, ncol=1 + length(experts) + 2))
61 names(data) = c("Date", experts, "Measure", "Station")
62 for (i in 1:length(stations))
64 stationInfo = get(stations[i])
65 #date index is sufficient; also add station index
66 stationInfo = cbind(Date = 1:nrow(stationInfo), stationInfo[,names(stationInfo) %in% experts], Measure = stationInfo[,"Measure"], Station = i)
67 data = rbind(data, stationInfo)
70 #extra step: order by date (would be a DB request)
71 data = data[order(data[,"Date"]),]