cleanIndex: Clean index inputs

Description Usage Arguments Details Value Source See Also Examples

Description

This function uses input parsing and replacement to coerce the character vector input into the index that the user was referencing. Primary useage is found in other smif.package functions which require uniform index identifiers.

Usage

1
cleanIndex(index, stops = TRUE)

Arguments

index

Character; string that must be coerced into an index identifier

stops

Logical; whether the function should stop and throw an error message if the ticker cannot be coerced

Details

cleanIndex will attempt to remove all non alphanumeric characters from index and will coerce all alphabetic characters to lowercase. It then compares them to possible formatted spellings of various indexes from indexIdentifier until a match is found. If no match is found, returns an error.

Value

Character; string representation of the given index

Source

indexIdentifier

See Also

indexIdentifier: internal dataset used to identify trivial cases

Other data cleaning functions: cleanAccount, cleanIP, cleanSector

Examples

1
cleanIndex("S&P 500")

alec25/smif.package documentation built on May 22, 2019, 12:36 p.m.