calculate_speed: Functions for calculating speed in m s-1 and pace in min...

View source: R/calculate_pace.R

calculate_speedR Documentation

Functions for calculating speed in m s-1 and pace in min km-1.

Description

Functions for calculating speed in m s-1 and pace in min km-1.

Usage

calculate_speed(seconds, metres)

calculate_pace(seconds, metres, round = NA)

Arguments

seconds

Numeric vector of time in seconds.

metres

Numeric vector of metres covered within the time period in seconds.

round

For calculate_pace, the number of digits to round the output too.

Value

Numeric vector of speed in m s-1 or pace in min km-1.

Author(s)

Stuart K. Grange

See Also

decimal_minute_to_string

Examples


# Calculate some speeds
calculate_speed(9.58, 100)
ms_to_km_h(calculate_speed(9.58, 100))

# Calculate pace of a run, the input takes seconds and metres
# Use seconds for time
calculate_pace(5400, half_marathon() * 1000)

# Or the hms data type
calculate_pace(parse_time("01:30:00"), half_marathon() * 1000)


skgrange/threadr documentation built on April 15, 2024, 9:35 p.m.