Checks for an sets several options like paths to data locations; and provides instructions for the .Rprofile entries needed to persist the settings.

setup_icews(data_dir, use_db = TRUE, keep_files = FALSE, r_profile = TRUE)

unset_icews_opts()

get_icews_opts()

## Arguments

data_dir

Where should the raw TSV data be kept?

use_db

Store events in a SQLite database?

keep_files

keep_files If using a database, retain raw data TSV files?

r_profile

If TRUE, this will write config parameters to a .Renviron file.

## Value

unset_icews_opts silently returns a list of prior option values to make it possible reset the values if needed. See get_icews_opts() and set_icews_opts().

get_icews_opts returns on object of class "icews_opts". Essentially a list containing the option values but with format and print methods.

## Details

Generally, the most flexible option is to keep both a database and the raw event files. As of late 2018, the database takes up about 8GB of space and the raw event files 5GB. The database contains several pre-built indices, which account for the extra space. Reading the raw data from files into memory takes about 2 minutes but from then on is more convenient and quicker for exploratory, interactive work. Queries on the database take longer, but don't require the initial loading into memory overhead. And with the right indices, it is possible to further cut down the time for specific queries.

Either way, I heavily recommend adding the option values to .Rprofile, to take away the trouble of having to deal with paths manually.

set_icews_opts()
if (FALSE) {