R中循环数据的等频分箱
我试图将风向数据划分为四个相等的频率区间,而不在 0°/360° 处有固定的中断。 我知道 funModeling 包中的 equal_freq()
函数,但该函数没有考虑风数据的循环性质,并通过从以下位置开始计算中断0°,结束于 360°。
有没有办法计算可以跨越 0 到 360 度之间的零跳的动态等频率?
这是一个最小的可重现示例:
wind_dirs<-runif(n=2000, min=0, max=360) #create a homogenous wind direction distribution
equal_freq(wind_dirs, 4) #this has a fixed break at 0° / 360°
我尝试了 R 中的circular包,但是没有等频分箱的函数。 我还考虑过手动定义断点,例如最主要的方向,但这会产生与 0° 处断点大致相同的问题。
任何想法都将不胜感激。
I am trying to divide my wind direction data into four equal frequency bins, without having a fixed break at 0° / 360°.
I am aware of the equal_freq()
function from the funModeling package, but this function does not take the circular nature of the wind data into account and calculates the breaks by starting at 0° and ending at 360°.
Is there a way to calculate dynamic equal frequencies that can span over the null jump between 0 and 360 degrees?
Here is a minimal reproducible example:
wind_dirs<-runif(n=2000, min=0, max=360) #create a homogenous wind direction distribution
equal_freq(wind_dirs, 4) #this has a fixed break at 0° / 360°
I tried the circular package in R, but there is no function for equal frequency binning.
I also considered manually defining a breakpoint, e.g. the most prevailing direction, but this creates about the same problem as a break at 0°.
Any ideas are greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论