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 -

c# - Create a Notification Object (Email or Page) At Run Time -- Dependency Injection or Factory -

Set Up Of Common Name Of SSL Certificate To Protect Plesk Panel -