── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (2): TierID, TierName
dbl (3): CollarID, E, N
dttm (1): DatetimeUTC
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Nun filtern wir nur einige Tage raus und machen darauf einen sf.
Specify a temporal windows for in which to measure Euclidean distances.
Das Sampling intervall ist 15min, also wenn man ein temporal window v of 60min nimmt, dann hat man im average 4 fixes included.
Euklidische Distanz:
pos[n-2] to pos[n]
pos[n-1] to pos[n]
pos[n] to pos[n+1]
pos[n] to pos[n+2]
b. Measure the distance from every point to every other point within this temporal window v. Also die Euklidische Distanz zwischen v (60min) und allen Punkten innerhalb.
We define a temporal window of 60 minutes. Given a 15-minute sampling interval, this corresponds to 4 observations. Therefore, for each focal point we consider two preceding and two following positions (n−2, n−1, n+1, n+2) when computing local movement intensity. It is only about: How many neighbours matter and no distance calculation.
v = 4
each point is compared with the 2 points before and 2 points after
Wir berechnen nurn die mean distance of nMinus2, nMinus1, nPlus1, nPlus2 for each row. Since we want the mean value per Row, we have to explicitly specify this before mutate() with the function rowwise(). To remove this rowwise-grouping, we end the operation with ungroup().
Note that for the first two positions, we cannot calculate a stepMean since there is no Position n-2 for these positions. This is also true for the last to positions (lacking a position n+2).
c. Remove “static points”: These are points where the average distance is less than a given threshold. This segments the trajectory into subtrajectories.Now remove short subtrajectories: These are trajectories with a short duration (whereas “short” is tbd).
We can now determine if an animal is moving or not by specifying a threshold distance on stepMean. In our example, we use the mean value as a threshold: Positions with distances below this value are considered static.
Rows: 34562 Columns: 7
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (4): user_id, weekday, place_name, transport_mode
dbl (2): lon_x, lat_y
dttm (1): datetime
ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
Methodisch wäre bei unregelmässigen Daten wie meinen eigentlich besser mit Distanz pro Zeit oder ein echtes Zeitfenster…. aber für diese Übung kann man das glaube ich so machen.
Exercise B: Similarity
library(tidyverse)
Warning: package 'tibble' was built under R version 4.5.2
Warning: package 'tidyr' was built under R version 4.5.2
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ forcats 1.0.1 ✔ stringr 1.5.2
✔ lubridate 1.9.4 ✔ tibble 3.3.1
✔ purrr 1.1.0 ✔ tidyr 1.3.2
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
Man sieht den Verlauf jeder Person /ID in der Richtung und kann Unterschiede schon erkennen. Im zweiten kann man die Wege trennen und sieht jeden Einzel. Sie gehen sehr ähnlich ausser nr 4 und 5.