Closed cells2numbers closed 5 years ago
Sample code
library(tidyverse) library(migrationminer) x = c(1,100,-2) y = c(1,-200,1) Track_Angle = atan2(tail(y, n = 1) - (y)[1], tail(x, n = 1) - (y)[1] ) %>% print (Track_Angle >= pi / 4) & (Track_Angle < 3 * pi / 4 ) # test windroseplot # up 1.5 # down -1.5 # left 3 # right 0 tracks <- tibble(Track_Angle = -c(-1.5, 3, -1.5, 3), Track_Speed = c(1,1,1,1), id = c(1,1,1,1)) plot_windrose(tracks)
Sample code