search for: mean_wd

Displaying 2 results from an estimated 2 matches for "mean_wd".

Did you mean: mean_sl
2023 May 13
2
aggregate wind direction data with wind speed required
...es also a second input variable, wind speed (ws). This is the function that I need to use: my_fun <- function(wd1, ws1){ u_component <- -ws1*sin(2*pi*wd1/360) v_component <- -ws1*cos(2*pi*wd1/360) mean_u <- mean(u_component, na.rm=T) mean_v <- mean(v_component, na.rm=T) mean_wd <- (atan2(mean_u, mean_v) * 360/2/pi) + 180 result <- mean_wd result } Does the aggregate function work only with functions with a single input variable (the one that I want to aggregate), or its use can be extended to functions with two input variables? Here a simple example (which is...
2023 May 13
1
aggregate wind direction data with wind speed required
...This is the function that I need to use: > > > my_fun <- function(wd1, ws1){ > > u_component <- -ws1*sin(2*pi*wd1/360) > v_component <- -ws1*cos(2*pi*wd1/360) > mean_u <- mean(u_component, na.rm=T) > mean_v <- mean(v_component, na.rm=T) > mean_wd <- (atan2(mean_u, mean_v) * 360/2/pi) + 180 > result <- mean_wd > result > } > > Does the aggregate function work only with functions with a single input variable (the one that I want to aggregate), or its use can be extended to functions with two input variables? >...