Learn R Programming

globaltrends (version 0.0.14)

start_db: Load globaltrends database and tables

Description

The function connects to the database file db/globaltrends_db.sqlite in the working directory. After connecting to the database connections to the database tables (through dplyr::tbl) are created. Data from the tables batch_keywords and batch_time are exported to the tibble objects keywords_control, keywords_object, time_control, and time_object.

Usage

start_db()

Arguments

Value

The function exports the following objects to the package environment globaltrends_db:

  • globaltrends_db A DBIConnection object, as returned by DBI::dbConnect(), connecting to the SQLite database in the working directory

  • tbl_doi A remote data source pointing to the table data_doi in the connected SQLite database

  • tbl_control A remote data source pointing to the table data_control in the connected SQLite database

  • tbl_mapping A remote data source pointing to the table data_mapping in the connected SQLite database

  • tbl_object A remote data source pointing to the table data_object in the connected SQLite database

  • tbl_score A remote data source pointing to the table data_score in the connected SQLite database

  • countries A character vector containing ISO2 country codes of countries that add at least 0.1\

  • us_states A character vector containing ISO2 regional codes of US states

  • keywords_control A tibble containing keywords of control batches

  • time_control A tibble containing times of control batches

  • keywords_object A tibble containing keywords of object batches

  • time_object A tibble containing times of control batches

  • keyword_synonyms A tibble containing synonymous keywords

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.

See Also

Examples

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

Run the code above in your browser using DataLab