1.打开R语言IDE环境
2.加载依赖包
library(TTR)
library(xts)
library(zoo)
library(quantmod)
3.以分析APPLE股票为例
getSymbols("AAPL")//从雅虎上下载苹果当日股票消息
dim(AAPL)//查看数据大小
head(AAPL)//查看前6行的数据
tail(AAPL)//查看后6行的数据
chartSeries(AAPL,theme="white")//柱状图
chartSeries(AAPL)
getSymbols("AAPL",from="2005-01-02",to="2010-12-31")
head(AAPL)
getSymbols("UNRATE",src="FRED")
head(UNRATE)
chartSeries(UNRATE,theme="white")
getSymbols("INTC",src="google")