handle_wunderground(action, location = NA, time_interval = NA, station_list = NULL, stations_to_choose_from = 25, drop_most = TRUE, end_at_present = TRUE)
the Weather underground database is described here: http://www.wunderground.com/ Note that I didn't find a comprehensive listing of all their airport weather stations, so I retrieved a list of airports from somewhere else. Weather underground doesn't have data for all the airports listed. There is also no information on the time periods that are covered. So finding the right airport to work with is a bit of trial and error. Weather underground has more stations, but I haven't been able to access them (for free).
under the 'list_stations' mode, several formats are possible for specifying the location vector, which can consist of either two or three coordinates (it can include elevation). Possible formats include c(1,2,3), c(1,2), c(x=1,y=2,z=3), c(lat=2,long=1,elev=3). If elements of the vector are not names, they are interpreted as c(Longitude, Latitude, Elevation).
The 'chillRCode' is generated by this function, when it is run with geographic coordinates as location inputs. In the list of nearby stations that is returned then, the chillRCode is provided and can then be used as input for running the function in 'downloading' mode. For downloading the data, use the same call as before but replace the location argument with the chillRCode. In this case this is the airport ICAO code.
Luedeling E, Kunz A and Blanke M, 2013. Identification of chilling and heat requirements of cherry trees - a statistical approach. International Journal of Biometeorology 57,679-689.
#stat_list<-get_weather(c(-120,38),time_interval=NA,"Wunderground")
#gw<-get_weather("KMHR",time_interval=c(2004,2004),"Wunderground")
#weather<-weather2chillR(gw)
#weather<-fix_weather(weather)
#tr<-tempResponse(stack_hourly_temps(weather),Start_JDay = 300,End_JDay = 30)
#make_chill_plot(tr,"Chill_Portions",start_year=2001,end_year=2004)
Run the code above in your browser using DataLab