View source: R/applydictionary.R
getAnyDictionaryValue | R Documentation |
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.
getAnyDictionaryValue(
varname,
searchcolumn = c("source_name", "generic_name"),
value = c("source_name", "generic_name", "dico", "type", "unknowns", "description",
"comments")
)
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"). |
This function is advanced and you should usually use getDicoOfVar or getVarAction
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.
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.