cm.school: Calculates the center of mass of a (simulated) school in 1D,...

View source: R/cm.school.R

cm.schoolR Documentation

Calculates the center of mass of a (simulated) school in 1D, 2D or 3D, or based on acoustic data.

Description

Calculates the center of mass of a (simulated) school in 1D, 2D or 3D, or based on acoustic data.

Usage

cm.school(school, mass = 1, subset = NULL, na.rm = TRUE, excl.neg = TRUE)

Arguments

school

is either a list of x-, y- and z-positions and mass of the fish (named "psxf", "psyf", "pszf" and "mass"), a list of x-, y- and z-positions and volume and acoustic intensity of the voxels (named "psxx", "psyx", "pszx", "volx" and "vbsc" or "mvbs"), or a matrix of columns holding the positions along each dimension.

mass

is the mass of the fish.

subset

is a numeric or logical vector defineing which positions to include in the calculation of center of mass.

na.rm

is used in sum().

excl.neg

is FALSE if negarive mass values are to be included in the calculation of the centers of mass of the school.


arnejohannesholmin/sonR documentation built on April 14, 2024, 11:39 p.m.