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

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -