Skip to contents

round_weights() rounds a selected numeric column in a movenet-format movement tibble. By default, the weight column is selected.

Usage

round_weights(data, unit, column = movenetenv$options$movedata_cols$weight)

Arguments

data

A movenet-format movement tibble.

unit

A positive number. The data in the selected column are rounded to the nearest multiple of this number. unit is additionally set as minimum possible value for the column.

column

Name of a single numeric column to round. By default this is the weight column (as specified in the loaded movement configurations).

Value

A movement tibble like data, but with rounding applied to the selected numeric column.

Details

Requires that the appropriate movement config file is loaded, to correctly identify the weight column in data.

The data in the selected column are modified by rounding to multiples of unit. Additionally, any data points < unit are set to unit, so that this becomes the minimum possible value in the column. This is to capture that any livestock movement, no matter how small, has an inherent risk that is conceptually closer to that of unit, than that of no movement at all.

See also

plyr::round_any(), which this function wraps.