subset_matrix_by_rows_cpp function

(C++) Subset Matrix by Rows

(C++) Subset Matrix by Rows

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)

Arguments

  • 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.

Returns

numeric matrix

Examples

#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, ]

See Also

Other Rcpp_auto_sum: auto_distance_cpp(), auto_sum_cpp(), auto_sum_full_cpp(), auto_sum_path_cpp()

  • Maintainer: Blas M. Benito
  • License: MIT + file LICENSE
  • Last published: 2025-02-01