I am trying to get mean wind speeds of a data-set based on its mean direction within a sector. It is fairly simple and the below program does the trick. I, however, am unable to automate it, meaning I have to manually input the values of
##Dummy Wind Speed and Directional Data.
fsector<-22.5 ##Starting point
esector<-45 ##End point
wind <- as.data.frame(cbind(ws,wd))
wind$test<- ifelse(wind$wd > fsector & wind$wd < esector,'mean','greater')
Actually I'm working with the same data. First I do a wind rose like this:
And then, depending the direction, I put the data:
max(Windspeed[direc >=11.25 & direc <= 33.75]) min(Windspeed[direc >=11.25 & direc <= 33.75]) mean(Windspeed[direc >=11.25 & direc <= 33.75])
I put he direccion in degrees. If you don't search that, I will be here waiting for help you.