Learn R Programming

globaltrends (version 0.0.14)

initialize_db: Initialize database

Description

The function creates a new database for the globaltrends package and creates all necessary tables within the database.

Usage

initialize_db()

Arguments

Value

Database is created.

Warning

SQLite databases only allow one writer at any instant in time. To run parallel downloads use one database for each download client and merge them once all downloads are complete.

Details

The function creates a new SQLite database for the globaltrends package. The database is saved as file db/globaltrends_db.sqlite in the working directory. If the folder db does not exists in the working directory, the folder is created. If the database already exists in the working directory, the function exits with an error. Within the database all tables are created and the default location sets are added to the respective table:

  • countries - all countries with a share in global GDP >= 0.1\ in 2018.

  • us_states - all US federal states and Washington DC.

After creating the database, the function disconnects from the database.

See Also

  • start_db()

  • disconnect_db()

  • countries()

  • us_states()

  • example_keywords()

  • example_time()

  • example_control()

  • example_object()

  • example_score()

  • example_doi()

  • https://www.sqlite.org/index.html

Examples

Run this code
if (FALSE) {
initialize_db()
}

Run the code above in your browser using DataLab