columnIndexOf | R Documentation |
Indices of data frame columns identified by name.
columnIndexOf(x, d, regexp = TRUE)
x |
name(s) of columns to be searched for |
d |
data frame whose columns shall be searched |
regexp |
If TRUE, |
indices of requested columns
Tomas Sieger
# Find indices of 'Petal.Length' and 'Sepal.Length' columns in the
# 'iris' data:
columnIndexOf(c('Sepal.Length','Petal.Length'),iris)
# Alternatively, using regular expressions:
columnIndexOf(c('.*Length'),iris)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.