frame_time: Convert between frame numbers and human readable time...

Description Usage Arguments Details Functions Examples

Description

NOTE: see examples for correct usage of times_to_frames.

Usage

1
2
3
4
5
6
7
frames_to_times(frames, frame_rate)

times_to_frames(seconds, frame_rate)

f2t(frames, frame_rate)

t2f(seconds, frame_rate)

Arguments

frames

A numerc vector of frame numbers to convert.

frame_rate

The frame rate of the tracking data in frames per second (e.g. tracks$params$frame_rate).

seconds

A character vector of times to convert (see examples).

Details

t2f and f2t provide convinient short-hands.

Functions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Using frame rate of 1 for clarity of usable formats
frames_to_times(1, 1)
frames_to_times(120, 1)
frames_to_times(3661, 1)

times_to_frames('5S', 1)
times_to_frames('2M 0S', 1)
times_to_frames('1H 1M 1S', 1)
times_to_frames('1H1M1S', 1)

# Note that the letters are not functional, just spaces work too:
times_to_frames('1 1 1', 1)
# Which means you can leave out larger denominations, but not smaller ones
times_to_frames('10S', 1) == times_to_frames('0M 10S', 1)
times_to_frames('2M', 1) == times_to_frames('2M 0S', 1)

Ax3man/trackr documentation built on Oct. 8, 2019, 10:53 p.m.