binArea: Calculate the approximate area for specified bins

View source: R/calculations.R

binAreaR Documentation

Calculate the approximate area for specified bins

Description

Calculate the area weighted value of a variable within a polygon

Usage

binArea(
  x,
  longitude,
  latitude,
  gridDiffLongitude,
  gridDiffLatitude,
  useArea = TRUE,
  areaLongitude,
  areaLatitude,
  useBins = TRUE,
  bins
)

Arguments

x

a vector of the data that is to be used to calculate the weighted area

longitude

a vector of the same length as x

latitude

a vector of the same length as x

gridDiffLongitude

a numerical value indicating the grid spacing in longitude space

gridDiffLatitude

a numerical value indicating the grid spacing in latitude space

useArea

a logical indicating if x should be subset within an area

areaLongitude

a vector of longitude values defining the area, ignored if useArea = FALSE

areaLatitude

a vector of latitude values defining the area, ignored if useArea = FALSE

useBins

logical indicating whether to bin x

bins

a vector defining how to bin x, ignored if useBins = FALSE

Value

a list of bin0 and bin1 which are the ranges in which data was averaged over. binArea, which is the calculated area within each bin range, npoints, which is the number of points included in the calculation. And finally, avg, which is the average value within the bin.

Author(s)

Chantelle Layton


clayton33/csasMarPhys documentation built on June 8, 2025, 3:10 a.m.