Oposum
Oposum

Reputation: 1243

load symbols using quantmod up to a specific date

How would I load the stock data of AMZN that does not include the stock prices after 2016-01-12?

The code to load the most up-to-date stock prices is this getSymbols("AMZN", auto.assign = FALSE) But I want to pretend that today is January 12th and eliminate the prices after that date. What would be the most convenient way to do that?

Upvotes: 0

Views: 479

Answers (1)

andrnev
andrnev

Reputation: 410

mySeries <- getSymbols("AMZN", auto.assign = FALSE)

t <- mySeries['::2016-01-12']

An explanation of subsetting is given here http://www.quantmod.com/examples/data/

Upvotes: 2

Related Questions