nhanesDXA: Import Dual Energy X-ray Absorptiometry (DXA) data.

View source: R/nhanes.R

nhanesDXAR Documentation

Import Dual Energy X-ray Absorptiometry (DXA) data.

Description

DXA data were acquired from 1999-2006.

Usage

nhanesDXA(year, suppl = FALSE, destfile = NULL, adjust_timeout = TRUE)

Arguments

year

The year of the data to import, where 1999<=year<=2006.

suppl

If TRUE then retrieve the supplemental data (default=FALSE).

destfile

The name of a destination file. If NULL then the data are imported into the R environment but no file is created.

adjust_timeout

Typically a logical flag indicating whether the default download.file timeout option should be adjusted by taking into account the size of the file to be downloaded, as reported by the server. The value can also be a positive numeric value, in which case it is used as a further multiplicative factor for the default calculation.

Details

Provide destfile in order to write the data to file. If destfile is not provided then the data will be imported into the R environment.

Value

By default the table is returned as a data frame. When downloading to file, the return argument is the integer code from download.file where 0 means success and non-zero indicates failure to download.

Examples

dxa_b <- nhanesDXA(2001)
dxa_c_s <- nhanesDXA(2003, suppl=TRUE)
## Not run: dxa = nhanesDXA(1999, destfile="dxx.xpt")

nhanesA documentation built on July 4, 2024, 9:08 a.m.