write_tweet_csv: Write Tweets to Spreadsheets

Description Usage Arguments Author(s) See Also Examples

View source: R/spreadsheets.R

Description

Write Tweets to Spreadsheets

Usage

1
2
3
4
5
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.

Author(s)

Brendan Knapp brendan.g.knapp@nps.edu

See Also

data.table::fwrite()

openxlsx::write.xlsx()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
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

write_tweet_csv(tweet_df, file_path = target_csv_file) 

# write Microsoft Excel files =========================================================
target_excel_file <- tempfile(fileext = ".xlsx")
target_excel_file

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)

knapply/tweetio documentation built on Dec. 22, 2020, 7:15 p.m.