rtweet (version 0.4.0)

parse_stream: parse_stream

Description

parse_stream

Usage

parse_stream(file_name, ...)

Arguments

file_name

name of file to be parsed. NOTE: if file was created via stream_tweets, then it will end in ".json" (see example below)

For developmental purposes.

Value

Data frame of tweets data with attributes users data

Details

Reading and simplifying json files can be very slow. To make things more managable, parse_stream_xl does one chunk of Tweets at a time and then compiles the data into a data frame.

Examples

Run this code
# NOT RUN {
## file extension automatically converted to .json whether or
## not file_name already includes .json
stream_tweets(q = "", timeout = 30,
              file_name = "rtweet-stream", parse = FALSE)
rt <- parse_stream("rtweet-stream.json")
## preview tweets data
head(rt)
## preview users data
head(users_data(rt))
## plot time series
ts_plot(rt, "secs")
# }

Run the code above in your browser using DataCamp Workspace