I have converted U and V component of wind to wind direction and magnitude. But didn't able to map this data using levelplot.
library(raster)
library(rgdal)
library(rasterVis)
library(lattice)
library(grid)
Ucomplist <- list.files(path = "F:/ShareBoth/yearly_variable_data/rasters/Ucomp_annual/Ucomp_annual/", full.names = TRUE)
length(Ucomplist)
U <- brick(Ucomplist)
Vcomplist <- list.files(path = "F:/ShareBoth/yearly_variable_data/rasters/Vcomp_annual/Vcomp_annual/", full.names = TRUE)
length(Vcomplist)
V <- brick(Vcomplist)
wd <- (180/pi)*(atan2(U,V))
ws <- sqrt(U^2+V^2)
data link
https://drive.google.com/drive/folders/1PwABGUDBVUWi50Vfn9pmC-Dyjkpmtyny?usp=sharing
expected output:
thanks in advance