tidy_gp_clinical: Tidy UK Biobank primary care clinical events

View source: R/sqlite_db.R

tidy_gp_clinicalR Documentation

Tidy UK Biobank primary care clinical events

Description

Reformats the UK Biobank primary care clinical events dataset to match the output format for tidy_clinical_events.

Usage

tidy_gp_clinical(gp_clinical, .details_only = FALSE)

Arguments

gp_clinical

The UK Biobank primary care clinical events dataset

.details_only

logical. If TRUE, return a character vector of output table names only

Details

The UK Biobank primary care clinical events data lists read codes in separate columns, one for Read2 and one for Read3. This function reshapes the data to long format so that all codes are in a single column. The index column values relate to row numbers in the original data.

The primary care data also contains 3 'value' columns. The clinical codes/dates in long format and 'value' columns are both returned in a list under the names 'clinical_events' and 'gp_clinical_values' respectively.

Value

A named list. Item 'clinical_events' contains the read codes with event dates, and item 'gp_clinical_values' contains the 'value' columns.

Other notes

By default, special date values (see resource 591 for further details) are set to NA.

See Also

tidy_clinical_events, make_clinical_events_db


rmgpanw/ukbwranglr documentation built on April 30, 2024, 7:47 a.m.