Skip to content

Commit

Permalink
one last update + made comaptible with new rtweet
Browse files Browse the repository at this point in the history
  • Loading branch information
mkearney committed Mar 19, 2018
1 parent 59407e4 commit bc14c77
Show file tree
Hide file tree
Showing 6 changed files with 638 additions and 638 deletions.
11 changes: 2 additions & 9 deletions R/search.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,13 @@ rt <- search_tweets(
if (file.exists(file.path("data", "search.rds"))) {

## bind rows (for tweets AND users data)
rt <- do_call_rbind(
list(rt, readRDS(file.path("data", "search.rds"))))
rt <- do.call("rbind", list(rt, readRDS(file.path("data", "search.rds"))))

## determine whether each observation has a unique status ID
kp <- !duplicated(rt$status_id)

## only keep rows (observations) with unique status IDs
users <- users_data(rt)[kp, ]
kp <- !duplicated(rt$status_id) & !is.na(rt$status_id)

## the rows of users should correspond with the tweets
rt <- rt[kp, ]

## restore as users attribute
attr(rt, "users") <- users
}

## save the data
Expand Down
Loading

0 comments on commit bc14c77

Please sign in to comment.