Skip to content
This repository has been archived by the owner on Nov 10, 2024. It is now read-only.

Commit

Permalink
Drop magrittr
Browse files Browse the repository at this point in the history
Fixes #522
  • Loading branch information
hadley committed Mar 8, 2021
1 parent 64ef854 commit 63a46db
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 61 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ Imports:
httr (>= 1.3.0),
jsonlite (>= 0.9.22),
lifecycle (>= 1.0.0),
magrittr (>= 1.5),
progress,
rappdirs,
tibble (>= 1.3.4),
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ S3method(print,screen_name)
S3method(print,user_id)
S3method(round_time,Date)
S3method(round_time,POSIXt)
export("%>%")
export(as_screenname)
export(as_userid)
export(bearer_token)
Expand Down Expand Up @@ -97,4 +96,3 @@ export(users_data)
export(users_with_tweets)
export(write_as_csv)
import(rlang)
importFrom(magrittr,"%>%")
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# rtweet ...

- rtweet no longer re-exports the pipe; if you want to continue using it, you'll
need to `library(magrittr)` or `library(dplyr)` (#522).
- `stream_tweets()` has been overhauled to only write valid data. This obsoletes
all previous strategy to cleen up bad data after the fact (#350, #356).
Expand Down
3 changes: 0 additions & 3 deletions R/imports.R

This file was deleted.

11 changes: 4 additions & 7 deletions R/post-list.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
#' cnn_users <- search_users("CNN", n = 200)
#'
#' ## filter and select more users to add to list
#' more_users <- cnn_users %>%
#' subset(verified & !tolower(screen_name) %in% tolower(users)) %>%
#' .$screen_name %>%
#' grep("cnn", ., ignore.case = TRUE, value = TRUE)
#' more_users <- cnn_users$screen_name[cnn_users$verified]
#' more_users <- setdiff(more_users, users)
#' more_users <- more_users[grepl("cnn", more_users, ignore.case = TRUE)]
#'
#' ## add more users to list- note: can only add up to 100 at a time
#' post_list(users = more_users, slug = "cnn-accounts")
Expand All @@ -47,9 +46,7 @@
#' rtweet:::api_screen_name()))
#'
#' ## select users on list without "cnn" in their name field
#' drop_users <- cnn_users %>%
#' subset(screen_name %in% more_users & !grepl("cnn", name, ignore.case = TRUE)) %>%
#' .$screen_name
#' drop_users <- cnn_users$screen_name[!grepl("cnn", cnn_users$screen_name, ignore.case = TRUE)]
#'
#' ## drop these users from the cnn list
#' post_list(users = drop_users, slug = "cnn-accounts",
Expand Down
14 changes: 3 additions & 11 deletions R/ts_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,14 @@
#' @examples
#'
#' \dontrun{
#'
#' ## search for tweets containing "rstats"
#' rt <- search_tweets("rstats", n = 10000)
#'
#' ## plot frequency in 1 min intervals
#' ts_plot(rt, "mins")
#'
#' ## plot multiple time series--retweets vs non-retweets
#' rt %>%
#' dplyr::group_by(is_retweet) %>%
#' ts_plot("hours")
#' ts_plot(dplyr::group_by(tmls, is_retweet), "hours")
#'
#' ## compare account activity for some important US political figures
#' tmls <- get_timeline(
Expand All @@ -44,9 +41,7 @@
#' ts_plot(dplyr::group_by(tmls, screen_name), "weeks")
#'
#' ## group by screen name and is_retweet
#' tmls %>%
#' dplyr::group_by(tmls, screen_name, is_retweet) %>%
#' ts_plot("months")
#' ts_plot(dplyr::group_by(tmls, screen_name, is_retweet), "months")
#'
#' }
#' @family ts_data
Expand Down Expand Up @@ -110,10 +105,7 @@ ts_plot_ <- function(data, by = "days", trim = 0L, tz ="UTC", ...) {
#' ts_data(sens, "weeks")
#'
#' ## group by screen name and then use weekly intervals
#' sens %>%
#' dplyr::group_by(screen_name) %>%
#' ts_plot("weeks")
#'
#' ts_plot(dplyr::group_by(sens, screen_name), "weeks")
#' }
#'
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/tweet_threading.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#' @examples
#' \dontrun{
#' tw <- lookup_statuses('1084143184664510470')
#' tw_thread <- tw%>%tweet_threading()
#' tw_thread <- tweet_threading(tw)
#' tw_thread
#' }
#' @seealso
Expand All @@ -36,7 +36,7 @@ tweet_threading <- function(tw, traverse = c('backwards','forwards'), n = 10, ve
for(i in traverse){
cat('\n')
.f <- get(sprintf('tweet_threading_%s',i),envir = asNamespace('rtweet'))
tw <- tw%>%.f(n,verbose)
tw <- .f(tw, n,verbose)
}

tw
Expand Down
11 changes: 4 additions & 7 deletions man/post_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions man/reexports.Rd

This file was deleted.

5 changes: 1 addition & 4 deletions man/ts_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 2 additions & 7 deletions man/ts_plot.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/tweet_threading.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 63a46db

Please sign in to comment.