Go from a file of raw tweet data to a convenient, {rtweet}-style data frame.

read_tweets(
  file_path,
  as_tibble = tweetio_as_tibble(),
  verbose = tweetio_verbose(),
  ...
)

read_tweets_bulk(
  file_path,
  as_tibble = tweetio_as_tibble(),
  verbose = tweetio_verbose(),
  in_parallel = TRUE,
  strategy = NULL,
  ...
)

Arguments

file_path

Path(s) to tweet files.

as_tibble

<logical>, Default: tweetio_as_tibble(). Whether a tibble::tibble() should be returned. Ignored if the {tibble} package is not installed.

verbose

<logical>, Default: tweetio_verbose(). Whether to show diagnostic or progress messages.

...

Arguments passed to or from other methods.

in_parallel

Default: TRUE. Whether to use future.apply::future_lapply() to process the files in parallel. Ignored if {future} or {future.apply} are not installed.

strategy

Default: NULL. argument passed to future::plan()'s strategy parameter. If NULL, future::multiprocess is used. Ignored if {future} or {future.apply} are not installed.

Value

Examples

path_to_tweet_file <- example_tweet_file() tweet_data.table <- read_tweets(file_path = path_to_tweet_file) tweet_tibble <- read_tweets(file_path = path_to_tweet_file, as_tibble = TRUE) tweet_tibble
#> # A tibble: 681 x 93 #> user_id status_id created_at screen_name text source #> <chr> <chr> <dttm> <chr> <chr> <chr> #> 1 194250… 11780078… 2019-09-28 18:05:23 Stgo_centro "RT … Twitt… #> 2 825459… 11780078… 2019-09-28 18:05:24 taylorxkas… "RT … Twitt… #> 3 218889… 11780078… 2019-09-28 18:05:24 markaduck "@_C… Twitt… #> 4 401300… 11780078… 2019-09-28 18:05:25 unmario "Fot… Insta… #> 5 294908… 11780078… 2019-09-28 18:05:25 ALmardoza21 "@Es… Twitt… #> 6 111622… 11780078… 2019-09-28 18:05:27 singhbhrme… "RT … Twitt… #> 7 231344… 11780078… 2019-09-28 18:05:27 barbimoral… "Mi … Twitt… #> 8 437465… 11780078… 2019-09-28 18:05:27 javii_sotoo "RT … Twitt… #> 9 117288… 11780078… 2019-09-28 18:05:29 nLfRH1 "RT … Twitt… #> 10 113247… 11780078… 2019-09-28 18:05:30 bexxxv97 "RT … Twitt… #> # … with 671 more rows, and 87 more variables: reply_to_status_id <chr>, #> # reply_to_user_id <chr>, reply_to_screen_name <chr>, is_quote <lgl>, #> # is_retweet <lgl>, hashtags <list>, urls_expanded_url <list>, #> # media_url <list>, media_expanded_url <list>, media_type <list>, #> # mentions_user_id <list>, mentions_screen_name <list>, lang <chr>, #> # quoted_status_id <chr>, quoted_text <chr>, quoted_created_at <dttm>, #> # quoted_source <chr>, quoted_favorite_count <int>, #> # quoted_retweet_count <int>, quoted_user_id <chr>, quoted_screen_name <chr>, #> # quoted_name <chr>, quoted_followers_count <int>, #> # quoted_friends_count <int>, quoted_statuses_count <int>, #> # quoted_location <chr>, quoted_description <chr>, quoted_verified <lgl>, #> # retweet_status_id <chr>, retweet_text <chr>, retweet_created_at <dttm>, #> # retweet_source <chr>, retweet_favorite_count <int>, #> # retweet_retweet_count <int>, retweet_user_id <chr>, #> # retweet_screen_name <chr>, retweet_name <chr>, #> # retweet_followers_count <int>, retweet_friends_count <int>, #> # retweet_statuses_count <int>, retweet_location <chr>, #> # retweet_description <chr>, retweet_verified <lgl>, place_url <chr>, #> # place_name <chr>, place_full_name <chr>, place_type <chr>, country <chr>, #> # country_code <chr>, bbox_coords <list>, status_url <chr>, name <chr>, #> # location <chr>, description <chr>, url <chr>, protected <lgl>, #> # followers_count <int>, friends_count <int>, listed_count <int>, #> # statuses_count <int>, favourites_count <int>, account_created_at <dttm>, #> # verified <lgl>, profile_url <chr>, account_lang <chr>, #> # profile_banner_url <chr>, profile_image_url <chr>, is_retweeted <lgl>, #> # retweet_place_url <chr>, retweet_place_name <chr>, #> # retweet_place_full_name <chr>, retweet_place_type <chr>, #> # retweet_country <chr>, retweet_country_code <chr>, #> # retweet_bbox_coords <list>, quoted_place_url <chr>, #> # quoted_place_name <chr>, quoted_place_full_name <chr>, #> # quoted_place_type <chr>, quoted_country <chr>, quoted_country_code <chr>, #> # quoted_bbox_coords <list>, timestamp_ms <dttm>, contributors_enabled <lgl>, #> # retweet_status_url <chr>, quoted_tweet_url <chr>, reply_to_status_url <chr>