process_files: Processes a folder of tweet files

View source: R/parseTweetFiles.R

process_filesR Documentation

Processes a folder of tweet files

Description

Processes all tweet-files in a directory and saves them in the given directory. This functions filters each files variables, removes symbols, emotes and stopwords, and tags tweets with zip codes if desired.

Usage

process_files(tweetdir, outputdir, loc = FALSE, vars = "text",
  makedf = TRUE, ...)

Arguments

tweetdir

The file directory of tweets to read from. No files other than the tweet files should be in this directory. The tweet files should be in the format as provided by streamR's parseTweets.

outputdir

The location to save the tweets to.

loc

True if the tweets should be tagged with zip codes. Uses 2014 shapefile from census.gov

vars

The variables to filter from the tweet files.

makedf

True if a dataframe containing all the edited tweets should be returned, false otherwise. Defaults to true.

...

tz and stoplist arguments for the inner clean.tweets call.

Value

The list of filenames edited.

Examples

## Not run: process_files("~/Documents/RawTweets", "~/Documents/EditedTweets")
## Not run: process_files("~/Documents/RawTweets", "~/Documents/EditedTweets", loc = TRUE,
vars = c("text", "time_zone"), tz = c("Eastern Time (US & Canada)", "NA"), stoplist = stoplist)
## End(Not run)

rturn/parseTweetFiles documentation built on July 31, 2023, 3:43 p.m.