t_time_difference: Add time difference column for weighted statistics

Description Usage Arguments Value Note Author(s) See Also Examples

View source: R/t_time_difference.R

Description

This functions generates a column with the time difference to the next coordinate. This is important since the GPS variables seldom have the same time difference and means and standard deviations should be weighted. The generated column can be used as "weight" variable.

Usage

1
2
3
4
t_time_difference(
  tracks, units = "secs", bind = TRUE, drop = TRUE, cname = "time_difference",
  t_id = "id"
)

Arguments

tracks

psyo. Data frame with tracks.

units

character. Same as for link[base]{difftime} but avoid using "auto". Auto could generate different units for the different tracks.

bind

logical. Return the distance as list (FALSE) or add it to tracks (TRUE).

drop

logical. If TRUE and only one observation is returned drop the data frame and collapse the return value to a vector.

cname

character. Column name of the returned calculation result.

t_id

character or numeric. Column name in tracks that identifies the separate tracks.

Value

psyo

Note

The time difference between the first and the second point is stored with the second point. This is done for higher compatibility with the gap functions.

Author(s)

Benjamin Ziepert. Please send feedback to: feedback-psyosphere@analyse-gps.com.

See Also

difftime, t_bearing,t_distance, t_speed

Examples

1
2
3
4
5
## Not run: 
data(psyo)
t_time_difference(psyo, units = "secs")

## End(Not run)

psyosphere documentation built on July 2, 2020, 12:08 a.m.