alignSymbols: Delete rows that not all Symbols have in common

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/alignSymbols.R

Description

Deletes rows that not all Symbols have in common

Usage

1
  alignSymbols(Symbols, env = .GlobalEnv)

Arguments

Symbols

character vector of symbol names which correspond to xts objects

env

The environment that holds the xts objects

Details

alignSymbols will get Symbols from the specified environment (.GlobalEnv by default), merge them together, and delete all rows that have any NAs. Then it will ‘unmerge’ and assign the cleaned data back to the xts objects named by Symbols.

Value

used for its side effect.

Author(s)

Garrett See

See Also

gsa, PF, merge, merge.xts, cbind, cbind.xts, assign

Examples

1
2
3
4
5
6
7
8
## Not run: 
Symbols <- c("SPY","DIA","CORN")
getSymbols(Symbols)
length(Cl(SPY));length(Cl(DIA));length(Cl(CORN))
alignSymbols(Symbols)
length(Cl(SPY));length(Cl(DIA));length(Cl(CORN))

## End(Not run)

qmao documentation built on May 2, 2019, 4:54 p.m.