Learn R Programming

tweet2r (version 1.1)

t2sqlite: Export TweeterJSON files to sqlite database and import to R as a Data Frame

Description

Export Json files retrieved with tweet2r to a Sqlite database and import tweets as a Data Frame.

Usage

t2sqlite(fileprefix, import, path = ".", pattern = ".json$")

Arguments

fileprefix

Setup file prefix for JSON files. If tweets have been retrieved with the tweet2r function, it should be the same name. The file prefix is used to create the table name and the geotagged table which will have geo as a prefix (example "geofileprefix")n. By default the database file will be save in the working directory with no file extension name. Sqlite is embedded in R within the package RSQLite. More information about Sqlite it its web page.

import

TRUE to import the tweets stored in the Sqlite database to R. It can be imported as a data frame with all the tweets retrieved with the function tweet2r. FALSE to not import as Data Frame

path

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

pattern

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

See Also

RSQLite, tweet2r, valjson

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
#File prefix name for json files and also the name of the database
fileprefix=tweets

t2sqlite(fileprefix, import, export)
# }

Run the code above in your browser using DataLab