Learn R Programming

FinancialInstrument (version 1.4.1)

all.equal.instrument: instrument all.equal method

Description

This is most useful for seeing the difference between two instrument objects.

Usage

# S3 method for instrument
all.equal(target, current, char.n = 2, collapse = ";", ...)

Value

`TRUE` when `target` and `current` are equal. Otherwise, a character vector describing differences between the two objects.

Arguments

char.n

If length of a character vector is char.n or less it will be treated as a single element. A negative value for char.n will be treated as if it were positive Inf.

collapse

Only used if a character vector is of length less than char.n. Unless collapse is NULL, it will be used in a call to paste. If collapse is NULL, each element of the character vector will be compared separately.

Author

Garrett See

See Also

getInstrument, instrument.table, buildHierarchy

Examples

Run this code
currency("USD")
stock("SPY", "USD", validExchanges=c("SMART", "ARCA", "BATS", "BEX"))
stock("DIA", "USD", validExchanges=c("SMART", "ARCA", "ISLAND"),
     ExtraField="something")

all.equal(getInstrument("SPY"), getInstrument("DIA"))
all.equal(getInstrument("SPY"), getInstrument("DIA"), char.n=5)
all.equal(getInstrument("SPY"), getInstrument("DIA"), char.n=5, collapse=NULL)

all.equal(getInstrument("DIA"), getInstrument("USD"))

Run the code above in your browser using DataLab