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
Post a Comment