I have seen the code somewhere, but haven't found it in the 30 mins I've been searching.
Here's the code I have for now
library('quantmod')
today <- Sys.Date()
getSymbols("SBUX")
retSBUX <- dailyReturn(SBUX)
starbucks <- data.frame(SBUX)
starbucks[,7] <- as.Date(row.names(starbucks))
row.names(starbucks) <- NULL
starbucks <- subset(starbucks, starbucks[,7] >= "2015-04-06" && starbucks[,7] <= today)
When I run this code, I get a data frame with 0 variable and just the column names in the data frame.