我有以下df
city <- data.frame(City = c("London", "Liverpool", "Manchester","London", "Liverpool", "Manchester"),
Date = c("2016-08-05","2016-08-09","2016-08-10", "2016-09-05","2016-09-09","2016-09-10"))
我想遍历它并通过city$City
for the data in获取天气数据city$Date
city <- data.frame(City = c("London", "Liverpool", "Manchester","London", "Liverpool", "Manchester"),
Date = c("2016-08-05","2016-08-09","2016-08-10", "2016-09-05","2016-09-09","2016-09-10"),
Mean_TemperatureC = c("15","14","13","14","11","14"))
目前我正在使用weatherData
以下功能获取天气数据:
library(weatherData)
df <- getWeatherForDate("BOS", "2016-08-01")
有人可以帮忙吗?