if (FALSE) {
getSymbols('QQQ',src='yahoo')
allReturns(QQQ) # returns all periods
periodReturn(QQQ,period='yearly',subset='2003::') # returns years 2003 to present
periodReturn(QQQ,period='yearly',subset='2003') # returns year 2003
rm(QQQ)
}
Run the code above in your browser using DataLab