Learn R Programming

tweet2r (version 1.1)

t2DataFrame: Parse tweets from JSON files and import to R

Description

A function to parse JSON files containing tweets stored using the function tweet2r. Tweets are stored as a data.frame ready to be use within R.

Usage

t2DataFrame(fileprefix, path = ".", pattern = ".json$")

Arguments

fileprefix

File prefix for JSON files where tweets has been stored after harvesting. If tweets have been retrieved with the tweet2r function it should be the same fileprefix name.

path

A character vector to folder. see ?list.files()

pattern

Limits possible file extensions, optional as regular expression. see ?list.files()

Value

tweets

Return harvested tweets with tweet2r as a data.frame.

See Also

tweet2r, streamR

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
  #json file prefix names
  fileprefix="tweets"
  
  #function to parse tweets from JSON file and import to R
  tweets<-t2DataFrame(fileprefix)
  
# }

Run the code above in your browser using DataLab