Write Tweets to Spreadsheets

write_tweet_csv(tweet_df, file_path, ...)

write_tweet_xlsx(tweet_df, file_path, asTable = TRUE, ...)

write_tweet_excel(tweet_df, file_path, asTable = TRUE, ...)

Arguments

tweet_df

A data frame of tweets, as obtained by read_tweets() or one of {rtweet}'s collection functions, e.g. rtweet::search_tweets().

file_path

File path to which to write or from which to read.

...

Arguments passed to or from other methods.

asTable

<logical>, default: TRUE.

See also

Examples

path_to_tweet_file <- example_tweet_file() # first 5 rows tweet_df <- read_tweets(file_path = path_to_tweet_file)[1:5, ] # write comma-separated values files ================================================== target_csv_file <- tempfile(fileext = ".csv") target_csv_file
#> [1] "/tmp/RtmpgRQ4gX/file722663a7311.csv"
write_tweet_csv(tweet_df, file_path = target_csv_file) # write Microsoft Excel files ========================================================= target_excel_file <- tempfile(fileext = ".xlsx") target_excel_file
#> [1] "/tmp/RtmpgRQ4gX/file722672b6e8c.xlsx"
write_tweet_xlsx(tweet_df, file_path = target_excel_file) # same as `write_tweet_xlsx()` write_tweet_excel(tweet_df, file_path = target_excel_file)