nhanesAttr function

Returns the attributes of an NHANES data table.

Returns the attributes of an NHANES data table.

Returns attributes such as number of rows, columns, and memory size, but does not return the table itself. This function is deprecated. Use nhanesTableSummary instead.

nhanesAttr(nh_table)

Arguments

  • nh_table: The name of the specific table to retrieve

Returns

The following attributes are returned as a list

nrow = number of rows

ncol = number of columns

names = name of each column

unique = true if all SEQN values are unique

na = number of 'NA' cells in the table

size = total size of table in bytes

types = data types of each column

Details

nhanesAttr allows one to check the size and other charactersistics of a data table before importing into R. To retrieve these characteristics, the specified table is downloaded, characteristics are determined, then the table is deleted. Downloads a table from the NHANES website as is, i.e. in its entirety with no modification or cleansing.

If the environment variable NHANES_TABLE_BASE was set during startup, the value of this variable is used as the base URL instead of https://wwwn.cdc.gov (this allows the use of a local or alternative mirror of the CDC data).

Examples

## Not run: bpx_e = nhanesAttr('BPX_E') ## Not run: length(bpx_e) ## Not run: folate_f = nhanesAttr('FOLATE_F') ## Not run: length(folate_f)
  • Maintainer: Christopher Endres
  • License: GPL (>= 2)
  • Last published: 2025-01-10