Create a wind-rose object
windrose(x, y, data, dtheta = 15)
The x component of wind speed, in which case the u and v components of that object are used for the components of wind speed, and y here is ignored.
The y component of wind speed (or stress).
Identifies dataframe
The angle increment (in degrees) within which to classify the data.
a windrose object, like oce::as.windrose with data slot containing
n
- the number of x values
x.mean
- the mean of hte x values
y.mean
- the mean of the y values
theta
- the central angel (in degrees for the class)
count
- the number of observation in this class
mean
- the mean of the observations in this class
fivenum
- the fivenum()
vector for observations in this class (min, the hinge, median, upper hinge and max)
if (FALSE) {
library(reshape2)
#' dates <- rep(as.Date(Sys.Date())-1,2)
dbkeys.bk <- data.frame(SITE="LZ40",DBKEY=c("IY031","IY032"),param=c("WNDD","WNDS"))
wnd.dat2 <- insight_fetch_daily(dates[1],dates[2],dbkeys.bk$DBKEY)
wnd.dat2 <- merge(wnd.dat2,dbkeys.bk,"DBKEY")
wnd.dat.xtab <- dcast(wnd.dat2,DATETIME~param,value.var = "Data.Value",mean)
wnd.dat.xtab$WNDS.ms <- wnd.dat.xtab$WNDS*0.44704
wnd.dat.xtab$u <- wnd.dat.xtab$WNDS.ms*cos(wnd.dat.xtab$WNDD*pi/180)
wnd.dat.xtab$v <- wnd.dat.xtab$WNDS.ms*sin(wnd.dat.xtab$WNDD*pi/180)
wind_dat <- windrose(u,v,wnd.dat.xtab)
}