Learn R Programming

amt (version 0.2.2.0)

calculate_sdr: 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"))

Value

Returns a numeric vector (of length 1) with the SDR in m^2/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".

Author

Johannes Signer and Brian J. Smith

See Also

get_displacement()

Examples

Run this code

# 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!)

Run the code above in your browser using DataLab