Learn R Programming

psyosphere (version 0.1.6)

average_duplicates: Correct coordinates with the same time

Description

Correct coordinates with the same time by replacing with one coordinate with a geomean position.

Usage

average_duplicates(tracks, t_id = "id")

Arguments

tracks

psyo. Data frame with tracks.

t_id

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

Value

psyo

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.

See Also

geomean, average_coordinates

Examples

Run this code
# NOT RUN {
\dontrun{
# Get data
data(psyo)
psyo <- psyo[c(1,15),]
psyo[2, c("time","id")] <- psyo[1, c("time","id")]

# Plot coordinates
map <- plot_map(psyo)
plot <- map + ggplot2::geom_point(data = psyo, size = 5)
plot <- plot_line(psyo[,c("lon", "lat")], plot = plot)
plot

# Calculate mean position
psyo <- average_duplicates(psyo)

# Plot mean position
plot + ggplot2::geom_point(data = psyo, size = 5)

}
# }

Run the code above in your browser using DataLab