calculate_sdr: Calculate SDR

View source: R/cleaning.R

calculate_sdrR Documentation

Calculate SDR

Description

Calculates squared displacement rate for a given speed and duration

Usage

calculate_sdr(speed = 50, time, speed_unit = c("km/h", "m/s"))

Arguments

speed

⁠[numeric]⁠ A speed given in either km/h or m/s.

time

⁠[Period]⁠ A lubridate Period for which the speed can be sustained.

speed_unit

⁠[character]⁠ The unit in which speed is given. Should be either "km/h" or "m/s".

Value

Returns a numeric vector (of length 1) with the SDR in m^2/s.

Author(s)

Johannes Signer and Brian J. Smith

See Also

get_displacement()

Examples


# Assume a cheetah can sprint 100 km/h for 60 seconds
calculate_sdr(speed = 100, time = seconds(60), speed_unit = "km/h")
# 46296.3 m^2/s

# What is expected displacement in 1 h at that SDR?
get_displacement(46296.3, hours(1))
# 12909.95 m = 12.9 km/h (much slower than sprint speed!)


amt documentation built on June 25, 2024, 1:14 a.m.