start_db {globaltrends} | R Documentation |
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()
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 directorytbl_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 stateskeywords_control A
tibble
containing keywords of control batchestime_control A
tibble
containing times of control batcheskeywords_object A
tibble
containing keywords of object batchestime_object A
tibble
containing times of control batcheskeyword_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
## Not run:
start_db()
## End(Not run)