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 - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -