Skip to contents

Somewhat fuzzily match entered variable names to mapped variable names, which might be useful if variable names are specified in a view, but are changed slightly in their source repositories.

Usage

datacommons_find_variables(missed, map = ".", sep = "[_:]", top = 3,
  metric = "cosine")

Arguments

missed

A vector of variable names or keywords to search for in the full set of mapped variables, or the name of or path to a data commons view, from which to extract missed variables.

map

Path to the variable_map.csv file created by datacommons_map_files, the path to a data commons project, or a variable map data.frame.

sep

A regular expression to be treated as a term separator.

top

Number of possible matches to return per missed entry.

metric

Name of the similarity metric to use; see lma_simets.

Value

A list with an entry for each entered variable, containing top possible matches, which are entries from the variable map, with an added .

Examples

if (FALSE) {
# from a data commons project directory
datacommons_find_variables(c("variable_a", "variable_b"))

# try to find matches to any missed variables in a view
datacommons_find_variables("view_name")
}