cost_path_sum_cpp | R Documentation |
(C++) Sum Distances in a Least Cost Path
cost_path_sum_cpp(path)
path |
(required, data frame) least-cost path produced by |
numeric
Other Rcpp_cost_path:
cost_path_cpp()
,
cost_path_diagonal_bandwidth_cpp()
,
cost_path_diagonal_cpp()
,
cost_path_orthogonal_bandwidth_cpp()
,
cost_path_orthogonal_cpp()
,
cost_path_slotting_cpp()
,
cost_path_trim_cpp()
#simulate two time series
x <- zoo_simulate(seed = 1)
y <- zoo_simulate(seed = 2)
#distance matrix
dist_matrix <- distance_matrix_cpp(
x = x,
y = y,
distance = "euclidean"
)
#least cost matrix
cost_matrix <- cost_matrix_orthogonal_cpp(
dist_matrix = dist_matrix
)
#least cost path
cost_path <- cost_path_slotting_cpp(
dist_matrix = dist_matrix,
cost_matrix = cost_matrix
)
cost_path_sum_cpp(
path = cost_path
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.