Extract: Extract or Replace elements of permutation vectors

ExtractR Documentation

Extract or Replace elements of permutation vectors

Description

Methods for "[" and "[<-", i.e., extraction or subsetting of permutation vectors.

Details

Extraction and replacement for word form uses array-based indexing. Cycle form uses list-based indexing and is thus less flexible.

Value

Extraction and methods return an onion or onionmat. Replacement methods return an object of the same class as the right hand side.

Note

Notes here

Author(s)

Robin K. S. Hankin

Examples


(a <- rperm(9))
a[1:3]
a[5:7] <- id  # word form: multiple replacements allowed.
a

x <- as.cycle(rperm(9))
x
x[5] <- x[4] * x[6]  # cycle form: replacement takes only a single index.
x


permutations documentation built on July 13, 2026, 5:07 p.m.