ukds_download: Download datasets from the UK Data Service

Description Usage Arguments Details Value Examples

View source: R/ukds_download.R

Description

ukds_download provides a programmatic and reproducible means to download datasets from the UK Data Service's data archive

Usage

1
2
3
4
ukds_download(file_id, org = getOption("ukds_org"),
  user = getOption("ukds_user"), password = getOption("ukds_password"),
  use = getOption("ukds_use"), reset = FALSE, download_dir = "ukds_data",
  msg = TRUE, convert = TRUE, delay = 5)

Arguments

file_id

The unique identifier (or optionally a vector of these identifiers). for the dataset(s) to be downloaded (see details).

org, user, password

Your UK Data Service organization, username, and password (see details).

use

The number of a 'use of data' you have registered with the UK Data Service (see details).

reset

If TRUE, you will be asked to re-enter your organization, username, and password.

download_dir

The directory (relative to your working directory) to which files from the UK Data Service will be downloaded.

msg

If TRUE, outputs a message showing which data set is being downloaded.

convert

If TRUE, converts downloaded file(s) to .RData format.

delay

If the speed of your connection to the UK Data Service is particularly slow, ukds_download may encounter problems. Increasing the delay parameter may help.

Details

To avoid requiring others to edit your scripts to insert their own organization, email, password, and use or to force them to do so interactively, the default is set to fetch this information from the user's .Rprofile. Before running ukds_download, then, you should be sure to add these options to your .Rprofile substituting your info for the example below:

options("ukds_org" = "UK Data Archive", "ukds_user" = "ukf0000000000", "ukds_password" = "password123!", "ukds_use" = "111111")

Value

The function returns downloaded files.

Examples

1
2
3
4
## Not run: 
 ukds_download(file_id = c())

## End(Not run)

ukds documentation built on May 30, 2017, 1:49 a.m.