R中循环数据的等频分箱

发布于 2025-01-18 22:49:17 字数 502 浏览 5 评论 0原文

我试图将风向数据划分为四个相等的频率区间,而不在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文