R plot dynamic wind direction as arrow over time

我怕爱的太早我们不能终老 提交于 2019-12-07 00:18:28

Try the Arrowhead function in the shape package with the angle argument:

angle of arrowhead (anti-clockwise, relative to x-axis), in degrees [0,360]; either one value or a vector

I'm not sure this matches with your description of wind direction, perhaps you need to subtract your wind directions from 360 degrees or something similar.

library(shape)
plot(1:nrow(a), rep(1,nrow(a)), pch=NA, ylim=c(0,5))
Arrowhead(x0 = 1:nrow(a), y0 = a$ws, angle=a$wd)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!