cols {RNAdecay} | R Documentation

## Indexes column names with multiple patterns (i.e., multigrep)

### Description

Identifies dataframe column names that have all of the pattern arguments (up to 4).

### Usage

    cols(df, w, x = NA, y = NA, z = NA)

### Arguments

`df` | a dataframe with column names to parse
`w, x, y, z` | character string or regular expression passed to grep pattern argument

### Details

Be aware that column data labels that are part of another data label are not advisable (e.g. mut1, mut2, mut1.mut2; cols(df,'mut1') will return indices for both 'mut1' and 'mut1.mut2' labeled columns

### Value

returns a vector of integer indices of the column names of `df` that match to all of `w`, `x`, `y`, and `z`

### Examples

    cols(data.frame(xyz=1:5,zay=6:10,ybz=11:15,tuv=16:20),'y','z') ## returns 1 2 3

[Package RNAdecay version 1.3.1 Index]