davidcarslaw / openair

Tools for air quality data analysis
https://davidcarslaw.github.io/openair/
GNU General Public License v2.0
305 stars 113 forks source link

Windrose per day for 10 days #363

Closed peterdevries-wag closed 1 year ago

peterdevries-wag commented 1 year ago

I have winddata (speed and direction) for in total 10 days in April 2004. I try to plot one windrose per day, but I only manage to plot them by weekday...

jack-davison commented 1 year ago

Morning,

{openair} currently does not have an option to automatically cut individual days.

I'd use the {lubridate} package to create a new "day" column, then use that in the type arg of windRose().

library(openair)

# get one week's worth of data
week <- selectByDate(mydata, start = "1/1/2000", end = "7/1/2000")

# create a new "day" column from the "date" column
week$day <- lubridate::date(week$date)

# use "type" arg w/ windrose
windRose(week, type = "day")

Created on 2023-08-31 with reprex v2.0.2

peterdevries-wag commented 1 year ago

Thank you, this works. You made my day (-:

jack-davison commented 1 year ago

Excellent - any more questions feel free to open a new issue.