This function summarises the values of a raster across latitudinal bands using a user-supplied function, such as mean.

summarise_by_lat(x, stat = mean)

Arguments

x

A raster.

stat

A function that summarises the values of x across latitudinal bands.

Value

The function returns a dataframe with the latitudinal coordinates of each band (`y') and the summary (`stat'),

Details

This routine is implemented within add_profile_lat.

Author

Edward Lavender

Examples

d <- summarise_by_lat(dat_gebco) utils::head(d)
#> y stat #> 1 56.34375 174.67772 #> 2 56.34792 149.93881 #> 3 56.35208 117.49825 #> 4 56.35625 86.30392 #> 5 56.36042 56.80203 #> 6 56.36458 42.89903