| Extract | R Documentation |
Methods for "[" and "[<-", i.e., extraction or
subsetting of permutation vectors.
Extraction and replacement for word form uses array-based indexing. Cycle form uses list-based indexing and is thus less flexible.
Extraction and methods return an onion or onionmat. Replacement methods return an object of the same class as the right hand side.
Notes here
Robin K. S. Hankin
(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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.