write_as_csv: Save Twitter data as a comma separated value file.

View source: R/save_as_csv.R

write_as_csvR Documentation

Save Twitter data as a comma separated value file.

Description

Saves as flattened CSV file of Twitter data.

Usage

write_as_csv(x, file_name, prepend_ids = TRUE, na = "", fileEncoding = "UTF-8")

save_as_csv(x, file_name, prepend_ids = TRUE, na = "", fileEncoding = "UTF-8")

Arguments

x

Data frame returned by an rtweet function.

file_name

Desired name to save file as. If file_name does not include the extension ".csv" it will be added automatically.

prepend_ids

Logical indicating whether to prepend an "x" before all Twitter IDs (for users, statuses, lists, etc.). It's recommended when saving to CSV as these values otherwise get treated as numeric and as a result the values are often less precise due to rounding or other class-related quirks. Defaults to true.

na

Value to be used for missing (NA)s. Defaults to empty character, "".

fileEncoding

Encoding to be used when saving to CSV. defaults to "UTF-8".

Value

Saved CSV files in current working directory.

See Also

Other datafiles: flatten(), read_twitter_csv()

Other datafiles: flatten(), read_twitter_csv()


rtweet documentation built on May 29, 2024, 7:47 a.m.