getmetadata_odf: Get variable labels or other metadata from a data frame in...

View source: R/getmetadata_odf.R

getmetadata_odfR Documentation

Get variable labels or other metadata from a data frame in opendataformat.

Description

Get access to information about the dataset and variables via the R-Studio Viewer or the web browser.

Usage

getmetadata_odf(input, type, language = "active")

Arguments

input

R data frame (df) or variable from an R data frame (df$var).

type

The metadata type you want to retrieve.Possible options are "label", "description", "url", "type", "valuelabels", or "languages".

language

Select the language in which the labels of the variables will be displayed. If no language is selected, the current/active language of the data frame will be used.

  • By default the language that is set to current is displayed (language = "current").

  • You can select the language by language code, e.g. language = "en".

Value

Documentation.

Examples

# get example data from the opendataformat package
df <- get(data("data_odf"))
# view the variable labels for all variables in English
getmetadata_odf(input = df, type = "label", language = "en")

# view the value labels for variable bap87 in English
getmetadata_odf(input = df$bap87, type = "valuelabel", language = "en")

# view the description for variable bap87 in English
getmetadata_odf(input = df$bap87, type = "description", language = "en")


opendataformat documentation built on April 3, 2025, 11:22 p.m.