rev_col_subset: Reverse Subset Column

View source: R/RcppExports.R

rev_col_subsetR Documentation

Reverse Subset Column

Description

Subsets the column by going from high indices to low (the reverse of the supported practice)

Usage

rev_col_subset(x, start, end)

Arguments

x

A matrix of dimensions M x N

start

A unsigned int that indicates the starting column.

end

A unsigned int that indicates the ending column.

Details

Consider a vector x=[[1,2],[3,4]]. By setting start=1 and end=0, the function would output x=[[2,1],[4,1]]. Start and end must be valid C++ matrix locations. (e.g. matrix cols start at 0 and not 1)

Value

A matrix with matrix rows displayed in reverse order

Author(s)

JJB

Examples

x = matrix(c(1,2,3,4), nrow = 2,byrow = TRUE)
rev_col_subset(x, 1, 0)

coatless/r-to-armadillo documentation built on Nov. 16, 2023, 5:32 a.m.