r - Use grep to parse column names -


there data frame want delete columns in there string xfl or xst in colname. colname not exclusively xfl can ktel_xfl or ktel_xst. know there has way grep?

here's approach:

# create cloumn index idx <- grep("x(fl|st)", colnames(dat), invert = true) # filter columns dat[idx] 

where dat name of data frame.


Comments

Popular posts from this blog

java - Unable to make sub reports with Jasper -

sql - The object name contains more than the maximum number of prefixes. The maximum is 2 -

scala - play framework: Modules were resolved with conflicting cross-version suffixes -