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

ruby on rails - Devise Logout Error in RoR -

model view controller - MVC Rails Planning -

php - Working with pretty urls on apache and fastcgi after hhvm installation -