steps | R Documentation |
step_lengths
can be use to calculate step lengths of a track. direction_abs
and direction_rel
calculate the absolute and relative direction of steps. steps
converts a track_xy*
from a point representation to a step representation and automatically calculates step lengths and relative turning angles.
direction_abs(x, ...)
## S3 method for class 'track_xy'
direction_abs(
x,
full_circle = FALSE,
zero_dir = "E",
clockwise = FALSE,
append_last = TRUE,
lonlat = FALSE,
...
)
direction_rel(x, ...)
## S3 method for class 'track_xy'
direction_rel(x, lonlat = FALSE, append_last = TRUE, zero_dir = "E", ...)
step_lengths(x, ...)
## S3 method for class 'track_xy'
step_lengths(x, lonlat = FALSE, append_last = TRUE, ...)
steps_by_burst(x, ...)
## S3 method for class 'track_xyt'
steps_by_burst(x, lonlat = FALSE, keep_cols = NULL, ...)
steps(x, ...)
## S3 method for class 'track_xy'
steps(x, lonlat = FALSE, keep_cols = NULL, ...)
## S3 method for class 'track_xyt'
steps(x, lonlat = FALSE, keep_cols = NULL, diff_time_units = "auto", ...)
x |
|
... |
Further arguments, none implemented |
full_circle |
|
zero_dir |
|
clockwise |
|
append_last |
|
lonlat |
|
keep_cols |
|
diff_time_units |
|
dierctions_*()
returns NA
for 0 step lengths.
step_lengths
calculates the step lengths between points a long the path. The last value returned is NA
, because no observed step is 'started' at the last point. If lonlat = TRUE
, step_lengths()
wraps sf::st_distance()
.
[numeric]
For step_lengths()
and direction_*
a numeric vector.
[data.frame]
For steps
and steps_by_burst
, containing the steps.
xy <- tibble(
x = c(1, 4, 8, 8, 12, 12, 8, 0, 0, 4, 2),
y = c(0, 0, 0, 8, 12, 12, 12, 12, 8, 4, 2))
trk <- make_track(xy, x, y)
# append last
direction_abs(trk, append_last = TRUE)
direction_abs(trk, append_last = FALSE)
# degrees
direction_abs(trk) |> as_degree()
# full circle or not: check
direction_abs(trk, full_circle = TRUE)
direction_abs(trk, full_circle = FALSE)
direction_abs(trk, full_circle = TRUE) |> as_degree()
direction_abs(trk, full_circle = FALSE) |> as_degree()
# direction of 0
direction_abs(trk, full_circle = TRUE, zero_dir = "N")
direction_abs(trk, full_circle = TRUE, zero_dir = "E")
direction_abs(trk, full_circle = TRUE, zero_dir = "S")
direction_abs(trk, full_circle = TRUE, zero_dir = "W")
# clockwise or not
direction_abs(trk, full_circle = TRUE, zero_dir = "N", clockwise = FALSE)
direction_abs(trk, full_circle = TRUE, zero_dir = "N", clockwise = TRUE)
# Bearing (i.e. azimuth): only for lon/lat
direction_abs(trk, full_circle = FALSE, zero_dir = "N", lonlat = FALSE, clockwise = TRUE)
direction_abs(trk, full_circle = FALSE, zero_dir = "N", lonlat = TRUE, clockwise = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.