Search code examples
rurltwittertweets

How to identify url in tweet using R


I want to identify those tweets containing URL in my twitter data set. For example, using the sign of "http://".

How to proceed it in R? for example the tweets texts are

  "@RainxDog @twitpic Please HELP #OccupyWallStreet and RT this video: http://t.co/vjwNR7TC"

  "@degamuna Please HELP #OccupyWallStreet and RT this video: http://t.co/vjwNR7TC"

Solution

  • You can use grep

    if(length(grep("http://",data))>0){
     data[grep("http://",data)]
    }