File: lists_users.R

package info (click to toggle)
r-cran-rtweet 1.1.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 18,224 kB
  • sloc: sh: 13; makefile: 2
file content (30 lines) | stat: -rw-r--r-- 743 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#' Get all lists a specified user subscribes to, including their own.
#'
#' @inheritParams get_timeline
#' @param reverse optional Set this to true if you would like owned lists
#'   to be returned first. See description above for information on
#'   how this parameter works.
#' @return data
#' @examples
#' if (auth_has_default()) {
#'
#' ## get lists subscribed to by R_Foundation
#' lists_users("ropensci")
#'
#' }
#'
#' @family lists
#' @export
lists_users <- function(user = NULL, reverse = FALSE, token = NULL, parse = TRUE) {
  params <- list(
    reverse = reverse
  )
  params[[user_type(user)]] <- user

  r <- TWIT_get(token, "/1.1/lists/list", params)
  if (parse) {
    r <- as_lists_users(r)
    r <- as.data.frame(r)
  }
  r
}