Learn R Programming

FinancialInstrument (version 1.3.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 equal.instrument
all(target, current, char.n = 2, collapse = ";",
  ...)

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.

See Also

getInstrument, instrument.table, buildHierarchy

Examples

Run this code
# NOT RUN {
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