ukbschemas_db: Create UK Biobank data schema database

Description Usage Arguments Details Value Examples

View source: R/ukbschemas-db.R

Description

ukbschemas_db() generates an SQLite database containing the UK Biobank data schemas from http://biobank.ctsu.ox.ac.uk/crystal/schema.cgi

Usage

1
2
3
ukbschemas_db(file = "", path = ".", date_str = Sys.Date(),
  overwrite = FALSE, silent = !interactive(), as_is = FALSE,
  url_prefix = UKB_URL_PREFIX)

Arguments

file

The filename for the schema database. Defaults to "", which is interpreted as paste0("ukb-schemas-", date, ".sqlite"). If this file already exists in directory path, the session is interactive, and overwrite is not FALSE, then the user will be prompted to decide whether the file should be overwritten.

path

The path to the directory where the file will be saved. Defaults to . (the current directory).

date_str

The date-stamp for the default filename. Defaults to the current date in YYYY-MM-DD format.

overwrite

Always overwrite existing files? Helpful for non-interactive use. Defaults to FALSE.

silent

Do not report progress. Defaults to FALSE.

as_is

Import the schemas into the database without tidying? Defaults to FALSE.

url_prefix

First part of the URL at which the schema files can be found. For local repositories, the directory with a trailing delimiter (i.e. / or \ or \\ as appropriate to your operating system).

Details

ukbschemas_db() uses ukbschemas to load the schemas and save_db to save the result.

Value

A database connection object of class RSQLite::SQLiteConnection.

Examples

1
2
3
4
## Not run: 
db <- ukbschemas_db(path = tempdir())

## End(Not run)

bjcairns/ukbschemas documentation built on Nov. 4, 2019, 7:22 a.m.