r - Removing rows with * prefixed string -
i have data frame given below
85 p 74 p 70 p 35 p 38 p 54 49 p 35 p 30 p 50 p 30 p 30 104 p 69 p 50 p 70 p 70 p 87 *44 p *35 p 8 f 10 f 9 f *37 *53 p 30 p *40 p 30 p *48 p *73 76 p 86 p 69 p 84 p 66 p 79 110 p 65 p 40 p 57 p 57 p 74
i need remove rows have string starting * using r. tried gsub
, sqldf
couldn't resolve it.
something :
df2<-df[!apply(df,1,function(rg){any(grepl("^\\*[a-za-z1-9]",rg))}),]
should work
Comments
Post a Comment