Skip to contents

glapply2() is variant of glapply() whereby a function that takes 2 geofields as arguments is applied element-wise to 2 geolists. It is equivalent to map2, but is explicitly for geolists.

Usage

glapply2(X, Y, FUN, ...)

Arguments

X

A geolist

Y

A geolist of the same length as X that is on the same domain.

FUN

The function to apply to X and Y.

...

Other arguments to FUN.

Value

A geolist of the same length as X and Y.

Examples

glapply2(
  ens_grid_df$grid_mbr000, ens_grid_df$grid_mbr001, function(x, y) x + y
)
#> <harp_geolist[24]>
#>  [[1]] <numeric geofield [5 x 5] Min = 0.180 Max = 1.843 Mean = 0.907>
#>  [[2]] <numeric geofield [5 x 5] Min = 0.301 Max = 1.743 Mean = 1.142>
#>  [[3]] <numeric geofield [5 x 5] Min = 0.498 Max = 1.820 Mean = 1.073>
#>  [[4]] <numeric geofield [5 x 5] Min = 0.124 Max = 1.788 Mean = 0.978>
#>  [[5]] <numeric geofield [5 x 5] Min = 0.242 Max = 1.628 Mean = 1.021>
#>  [[6]] <numeric geofield [5 x 5] Min = 0.168 Max = 1.745 Mean = 1.030>
#>  [[7]] <numeric geofield [5 x 5] Min = 0.204 Max = 1.862 Mean = 0.925>
#>  [[8]] <numeric geofield [5 x 5] Min = 0.084 Max = 1.909 Mean = 0.927>
#>  [[9]] <numeric geofield [5 x 5] Min = 0.225 Max = 1.807 Mean = 1.067>
#> [[10]] <numeric geofield [5 x 5] Min = 0.085 Max = 1.520 Mean = 0.886>
#> # 14 more geofields
#> # Use `print(n = ...)` to see more
#>