FinancialInstrument (version 1.3.1)

add.defined.by: Add a source to the defined.by field of an instrument

Description

Concatenate a string or strings (passed through dots) to the defined.by field of an instrument (separated by semi-colons). Any duplicates will be removed. See Details.

Usage

add.defined.by(primary_ids, ...)

Arguments

primary_ids

character vector of primary_ids of instruments

...

strings, or character vector, or semi-colon delimited string.

Value

called for side-effect

Details

If there is already a value for the defined.by attribute of the primary_id instrument, that string will be split on semi-colons and converted to a character vector. That will be combined with any new strings (in ...). The unique value of this new vector will then be converted into a semi-colon delimited string that will be assigned to the defined.by attribute of the primary_ids' instruments

Many functions that create or update instrument definitions will also add or update the value of the defined.by attribute of that instrument. If an instrument has been updated by more than one function, it's defined.by attribute will likely be a semi-colon delimited string (e.g. “TTR;yahoo”).

See Also

add.identifier, instrument_attr

Examples

Run this code
# NOT RUN {
update_instruments.TTR("GS")
getInstrument("GS")$defined.by #TTR
add.defined.by("GS", "gsee", "demo")
add.defined.by("GS", "gsee;demo") #same
# }

Run the code above in your browser using DataCamp Workspace