nhs_download: Download data from 'NHANES' database

Description Usage Arguments Value Examples

View source: R/nhs_download.R

Description

Download data from 'NHANES' database

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
nhs_download(
  years,
  items,
  files,
  mode,
  xpt = TRUE,
  tsv = TRUE,
  varLabel = TRUE,
  codebook = TRUE,
  update = TRUE,
  filetable = NULL,
  cat = TRUE,
  redown = TRUE
)

Arguments

years

one or more years

items

one or more items

files

which files to be download

mode

character. The mode with which to write the file. Useful values are "wb" (binary), "w" and "ab".

xpt

logical. whether to download original data

tsv

logical. whether to restore tsv file

varLabel

logical. whether to restore varLabel file

codebook

logical. whether to restore codebook file.

update

logical. whether to restore upate file.

filetable

ignore. only used in update.

cat

logical. whether to print download process.

redown

logical. whether to download the existed file.

Value

download 'NHANES' database data into local computer and keep the same order.

Examples

1
2
3
4
5
# nhs_download(years = 2007,items = 'Laboratory',files = 'tfr_e',mode = 'wb',
#              xpt = FALSE,tsv = FALSE,varLabel = TRUE,
#              codebook = FALSE,update = FALSE,redown = FALSE)

# nhs_download(years = c(2017,2019),items = c('d','l'))

yikeshu0611/nhanesR documentation built on Jan. 29, 2022, 6:08 a.m.