R: grep, what am I doing wrong? -
R: grep, what am I doing wrong? -
i want chracter positions of "_" in string:
mystring<-"test_test_test" grep("_", mystring) this returns however:
[1] 1 what doing wrong?
use gregexpr rather grep
mystring<-"test_test_test" > gregexpr('_', mystring) [[1]] [1] 5 10 attr(,"match.length") [1] 1 1 attr(,"usebytes") [1] true r grep
Comments
Post a Comment