Description Usage Arguments Value Note Author(s) Examples
View source: R/col_selector_v1.R
function for precise selecting/ reordering columns with similar names within a data frame. It is suggested to use it after the function col_agrecounter() to select only columns of interest
1 | col_selector(inputDF, key_words)
|
inputDF |
data frame with headings and at least two columns |
key_words |
vector of characters to reorganize columns. Use special characters to extract key_words: *=any character; ^=block beginning of the string , $=block end of the string |
returns data freme with columns defined in key_words argument
use Regular Expression Syntax to precisely select columns
Zofia Wicik
1 2 3 4 5 6 | #example###
inputDF<-iris
names(inputDF)
key_words<-c("Species", "*Width", "*Length")
temp<-col_selector(inputDF,key_words)
names(temp) #width and lenght is now grouped together
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.