Learn R Programming

psyosphere (version 0.1.6)

average_coordinates: Calculates the mean position of coordinates within a time interval.

Description

Calculates the mean position of coordinates within a time interval.

Usage

average_coordinates(tracks, num, units = "minutes", t_id = "id")

Arguments

tracks

psyo. Data frame with tracks.

num

num The amount of time.

units

char Unit for time measurement. For example: "seconds", "minutes" or "days". See duration for more details.

t_id

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

Value

data frame

lon

num averaged longitude

lat

num averaged latitude

time

POSIXct averaged time

other

Preserved columns from input

Credit

If you use 'psyosphere' for commercial use or research, please support us by include one off the following references:

  • MIT license: "psyosphere" by B. Ziepert, E. G. Ufkes & P. W. de Vries from https://CRAN.R-project.org/package=psyosphere

  • APA: Ziepert, B., Ufkes, E., & de Vries, P. W. (2018). psyosphere: Analyse GPS Data. Retrieved from https://CRAN.R-project.org/package=psyosphere

  • APA: Vries, P., Ziepert, B., & Ufkes, E. (2016). "De psychologie van bewegingen GPS-technologie voor de analyse van natuurlijk gedrag." Tijdschrift voor Human Factors 2: 11-15.

Details

This function can be used to compress huge amounts of data to speed up the calculations.

The average for the columns time, lon and lat is calculated. See geomean for details. Other columns will be preserved but only the first row of every interval is considered.

See Also

geomean, average_duplicates, select_test_sample

Examples

Run this code
# NOT RUN {
data(psyo_geomean)
average_coordinates(psyo_geomean,30,"seconds")
# }

Run the code above in your browser using DataLab