Description Usage Arguments Examples
View source: R/get_col_indexes.R
Reads a dataframe and returns the column indexes that match to a specific pattern. If input is not a dataframe, returns an error. You can set the first argument as.data.frame(x).
1 | get_col_indexes(x, id)
|
x |
A dataframe to with the columns of interest |
id |
Vector contaning character identifiers for the columns of interest. You can match the column names partially (see example). |
1 2 3 4 5 | x <- data.frame(one = 1, two = 2, three = 3, four = 4)
vect <- c("o", "wo")
get_col_indexes(x, "wo")
get_col_indexes(x, vect)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.