register_db_backend: Functions to setup a database backend for twitteR

Description Usage Arguments Details Value Author(s) See Also Examples

Description

twitteR can have a database backend registered from which to store and load tweet and user data. These functions provide mechanisms for setting up the connection within twitteR

Usage

1
2
3
register_db_backend(db_handle)
register_sqlite_backend(sqlite_file, ...)
register_mysql_backend(db_name, host, user, password, ...)

Arguments

db_handle

A DBI connection

sqlite_file

File path for a SQLite file

db_name

Name of the database to connect to

host

Hostname the database is on

user

username to connect to the database with

password

password to connect to the database with

...

extra arguments to pass to dbConnect

Details

Currently only RSQLite and RMySQL are supported. To use either of these DBI implementations the appropriate packages will need to be installed.

The register_sqlite_backend and register_mysql_backend are convenience wrappers to both create the DBI connection and call register_db_backend for you.

Value

The DBI connection, invisibly

Author(s)

Jeff Gentry

See Also

store_tweets_db, store_users_db, load_tweets_db, load_users_db

Examples

1
2
3
4
5
6
7
   ## Not run: 
    register_sqlite_backend("/path/to/sqlite/file")
    tweets = searchTwitter("#scala")
    store_tweets_db(tweets)
    from_db = load_tweets_db()
   
## End(Not run)

agbaca/twitteR documentation built on May 10, 2019, 7:32 a.m.