ind2path | R Documentation |
path
from indices of coordinatesConvert a vector of 2D coordinate indices into a path
data.frame. If ind
is a matrix,
each row represents the path of a different trajectory j
.
This function is the main way to create path
in GeoPressureR, and is used by
graph_most_likely
, graph_simulation
and tag2path
.
ind2path(ind, tag_graph, use_known = TRUE)
ind |
vector of indices of the 2D map (vector or matrix) |
tag_graph |
either a |
use_known |
If true, enforce the known position in the path created. The known positions are approximated to the map resolution in order to corresponds to integer index. |
A path data.frame
stap_id
stationary period identification
j
identification for each trajectory (1
to nj
).
lat
Latitude,
lon
longitude
...
other columns from stap
Other path:
path2edge()
,
path2elevation()
,
plot_path()
withr::with_dir(system.file("extdata", package = "GeoPressureR"), {
tag <- tag_create("18LX", quiet = TRUE) |>
tag_label(quiet = TRUE) |>
tag_set_map(c(-16, 23, 0, 50), scale = 1)
})
# ind generated by `graph_most_likely` (single trajectory - vector)
ind <- c(1652, 1603, 1755, 1708, 1607)
path <- ind2path(ind, tag)
knitr::kable(path)
# ind generated by `graph_simulation` (10 trajectories - matrix)
ind <- matrix(c(
1652, 1652, 1652, 1652, 1652, 1652, 1652, 1652, 1652, 1652,
1653, 1606, 1653, 1504, 1604, 1704, 1504, 1653, 1753, 1701,
1805, 1457, 1408, 1657, 1609, 1903, 1506, 1757, 1856, 1804,
1607, 1514, 1611, 1457, 1860, 1802, 1759, 1609, 1760, 1208,
1505, 1314, 1559, 1357, 1758, 1852, 1661, 1706, 1862, 1358
), nrow = 10)
path <- ind2path(ind, tag)
knitr::kable(head(path, n = 15))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.