[R] Output from as.windrose() in oce package baffles me

Waichler, Scott R Scott.Waichler at pnl.gov
Thu Sep 3 21:36:34 CEST 2009


I'm having trouble understanding the output from as.windrose().  For one
thing, data on a boundary between sectors seem to be left out of the
counts.  I assume that explains the missing point in the output below
(angle 45).  Shouldn't one side of each sector interval be open, to
include values such as my 45 in the example?  Also, why does the angle
180 in my input apparently not result in a count of 1 for the output for
180?  The $data$theta value of 180 refers to a sector centered at 180
whose angle is 90, correct?

library(oce)

# azimuths <- c(22.5, 45, 90, 180, 270)  # 0 and 360=north, 90=east,
180=south, 270=west
angles <- c(67.5, 45, 0, 270, 180)  # geometric equivalents of azimuths
radians <- angles * pi /180
x <- round(cos(radians), 6)
y <- round(sin(radians), 6)
w <- as.windrose(x, y, dtheta = 90) # make a windrose object, oce
package

# part of windrose object w:
$data$theta
[1]  90 180 270 360

$data$count
[1] 1 0 1 1

Thanks,
Scott Waichler
Pacific Northwest National Laboratory
scott.waichler at pnl.gov




More information about the R-help mailing list