getAnyDictionaryValue: Retrieve values from a dictionary based on variable name and...

View source: R/applydictionary.R

getAnyDictionaryValueR Documentation

Retrieve values from a dictionary based on variable name and specified columns

Description

This function searches a dictionary for a given variable name and returns the corresponding values from specified dictionary columns. It issues a warning if the search column or the value column is not present in the dictionary.

Usage

getAnyDictionaryValue(
  varname,
  searchcolumn = c("source_name", "generic_name"),
  value = c("source_name", "generic_name", "dico", "type", "unknowns", "description",
    "comments")
)

Arguments

varname

The variable name to search for in the dictionary.

searchcolumn

A character vector specifying which column(s) to search in the dictionary. Defaults to c("source_name", "generic_name").

value

A character vector specifying which column(s) to return values from. Defaults to c("source_name", "generic_name", "dico", "type", "unknowns").

Details

This function is advanced and you should usually use getDicoOfVar or getVarAction

Value

Returns the subset of the dictionary that matches the search criteria or NA if no matches are found or if the search/value columns are not in the dictionary.

Examples

# Assuming 'getDictionary' is a function that returns a data frame and 'varname' is a known variable
getAnyDictionaryValue(varname = "exampleVar")
## Not run: getAnyDictionaryValue("varname",searchcolumn="source_name",value="dico")

Epiconcept-Paris/STRAP-epiuf documentation built on Aug. 5, 2024, 3:41 a.m.