Description Usage Arguments Details Value Examples
Extract a subset of a matrix based on regex patterns on either the rownames, the colnames or both. Once this subset has been selected, assignments can be made following standard consistency rules.
1 |
m |
A matrix from which to select a subset |
row.pat |
A regular expression to use for rownames |
col.pat |
A regular expression to use for colnames |
... |
Additional arguments to pass to grep |
Oftentimes it is useful to get at a specific subset of data within a matrix.
In large matrices, it can be cumbersome to access specific rows and/or
columns using traditional subsetting methods, particularly if it is a complex
set that is to be extracted. select
provides regex searching on named
matrices to access portions of a matrix that satisfy the regex. Note that
select
will work for data.frames as well.
It is possible to assign values to the selected subset as a means to modify the original matrix. Standard consistency rules must be satisfied for any assignment operations.
A matrix containing all rows and columns that satisfy the patterns given. If no values match, then an empty matrix will be returned.
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.