select_metadata allows users to retrieve the value of a specific field or fields of a given variable, or the entire variable metadata if no field is specified

select_metadata(variable_name = NULL, fields = NULL,
  returnDataFrame = TRUE)

Arguments

variable_name

name of variable

fields

specific field or list of fields of variable to be accessed. See details for valid field names

returnDataFrame

optional paramater set to TRUE by default, output is named list if set to FALSE

Value

returns string with value of a given field if field is specified, returns all metadata for variable as data frame if field is unspecified

Details

List of valid field names:

  • data_source

  • data_type

  • group_id

  • group_subid

  • id

  • label

  • leaf

  • name

  • old_name

  • respondent

  • responses

  • scope

  • section

  • topic

  • umbrella

  • warning

  • wave

Examples

select1 <- select_metadata(variable_name = "ce3agefc") select2 <- select_metadata(variable_name = "ce3agefc", fields = "data_type") select3 <- select_metadata(variable_name = "ce3agefc", fields = c("data_type", "data_source"))