View source: R/nhanes_tables.R
nhanesTableVars | R Documentation |
Enables quick display of table variables and their definitions.
nhanesTableVars(
data_group,
nh_table,
details = FALSE,
nchar = 128,
namesonly = FALSE
)
data_group |
The type of survey (DEMOGRAPHICS, DIETARY, EXAMINATION, LABORATORY, QUESTIONNAIRE). Abbreviated terms may also be used: (DEMO, DIET, EXAM, LAB, Q). |
nh_table |
The name of the specific table to retrieve. |
details |
If TRUE then all columns in the variable description are returned (default=FALSE). |
nchar |
The number of characters in the Variable Description to print. Default length is 128, which is set to enhance readability cause variable descriptions can be very long. |
namesonly |
If TRUE then only the variable names are returned (default=FALSE). |
NHANES tables may contain more than 100 variables. Function nhanesTableVars provides a concise display of variables for a specified table, which helps to ascertain quickly if the table is of interest. NULL is returned when an HTML read error is encountered.
Returns a data frame that describes variable attributes for the specified table. If namesonly=TRUE, then a character vector of the variable names is returned.
lab_cbc = nhanesTableVars('LAB', 'CBC_E')
dim(lab_cbc)
exam_ohx = nhanesTableVars('EXAM', 'OHX_E', details=TRUE, nchar=50)
dim(exam_ohx)
demo = nhanesTableVars('DEMO', 'DEMO_F', namesonly = TRUE)
length(demo)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.