subset_matrix_by_rows_cpp | R Documentation |
Subsets a time series matrix to the coordinates of a trimmed least-cost path when blocks are ignored during a dissimilarity analysis.
subset_matrix_by_rows_cpp(m, rows)
m |
(required, numeric matrix) a univariate or multivariate time series. |
rows |
(required, integer vector) vector of rows to subset from a least-cost path data frame. |
numeric matrix
Other Rcpp_auto_sum:
auto_distance_cpp()
,
auto_sum_cpp()
,
auto_sum_full_cpp()
,
auto_sum_path_cpp()
#simulate a time series
m <- zoo_simulate(seed = 1)
#sample some rows
rows <- sample(
x = nrow(m),
size = 10
) |>
sort()
#subset by rows
m_subset <- subset_matrix_by_rows_cpp(
m = m,
rows = rows
)
#compare with original
m[rows, ]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.