Skip to contents

Reads the UK Biobank codings file into R with all columns as type character.

Usage

get_ukb_codings(path = NULL)

Arguments

path

Either NULL, or a file path. If no file exists at this path, then it will be downloaded directly from the UK Biobank data showcase website to this location when the function is first called.

Value

A data frame.

Details

By default, an attempt will be made to read from a file at the path specified by an environmental variable named UKB_CODINGS (see vignette('ukbwranglr') for further details), or if this variable is not found then the data dictionary will be downloaded directly from the UK Biobank website to tempdir() when the function is first called.

Examples

get_ukb_data_dict(
  get_ukb_dummy("dummy_Codings.tsv", path_only = TRUE)
)
#>      Coding  Value
#>      <char> <char>
#>   1:      8      1
#>   2:      8     10
#>   3:      8     11
#>   4:      8     12
#>   5:      8      2
#>  ---              
#> 421:    240   H011
#> 422:    240   H013
#> 423:    240   H018
#> 424:    240   H019
#> 425:    240   H022
#>                                                             Meaning
#>                                                              <char>
#>   1:                                                        January
#>   2:                                                        October
#>   3:                                                       November
#>   4:                                                       December
#>   5:                                                       February
#>  ---                                                               
#> 421: H01.1 Emergency excision of abnormal appendix and drainage HFQ
#> 422:                    H01.3 Emergency excision of normal appendix
#> 423:           H01.8 Other specified emergency excision of appendix
#> 424:               H01.9 Unspecified emergency excision of appendix
#> 425:                       H02.2 Planned delayed appendicectomy NEC