average_duplicates {psyosphere}R Documentation

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:

Author(s)

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

See Also

geomean, average_coordinates

Examples

# Get data
data(psyo)
data(psyo_map)
psyo <- psyo[c(1,15),]
psyo[2, c("time","id")] <- psyo[1, c("time","id")]

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

# Calculate mean position
psyo <- psyosphere::average_duplicates(psyo)

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

[Package psyosphere version 0.1 Index]