# 3.5.8.14 Lookup

## Description

This function searches for a string pattern str within a vector vs and, if found, returns a value from vector vref with the same index. Vector vref may be contain numeric or string values. By default, the function searches vs for the full string (option = 2). If no match if found and vref is numeric, the function returns a missing value ("--"); when vref contains strings, an empty string is returned.

The function will return the closest match, using option =0 or =1, but Lookup() does not support wildcard characters.

This function also searches for a numeric value dd within a vector vd and, returns a value from vector vref with the same index. By default, the function seaches vd for the closest value (option = 2). If option = 0, it searchs for the closest value smaller than dd. If option = 1, it searchs for the closest value larger than dd.

## Syntax

If vref contains numeric values,