Я ищу хороший R-код (или пакет), который использует ggplot2 для создания ветровых роз, которые показывают частоту, масштаб и направление ветры.
Меня особенно интересует ggplot2, поскольку создание сюжета таким образом дает мне возможность использовать остальную функциональность там.
Тестируемые данные
Загрузите данные о погоде с 80-метрового уровня на башня National Wind Technology "M2" . Эта ссылка создаст CSV файл, который будет автоматически загружен. Вам нужно найти этот файл (он называется "20130101.csv" ) и прочитать его.
# read in a data file
data.in <- read.csv(file = "A:/drive/somehwere/20130101.csv",
col.names = c("date","hr","ws.80","wd.80"),
stringsAsFactors = FALSE))
Это будет работать с любым CSV файлом и будет перезаписывать имена столбцов.
Пример данных
Если вы не хотите загружать эти данные, вот 10 точек данных, которые мы будем использовать для демонстрации процесса:
data.in <- structure(list(date = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L),.Label = "1/1/2013", class= "factor" ), hr = 1: 9, ws.80 = c (5, 7, 7, 51,9, 11, 12, 9, 11, 17), wd.80 = c (30, 30, 30, 180, 180, 180, 269, 270, 271)),.Names = c ( "date", "hr", "ws.80", "wd.80" ), row.names = c (NA, -9L), class= "data.frame" )