Created
January 3, 2012 23:26
-
-
Save xoba/1557537 to your computer and use it in GitHub Desktop.
loading yahoo finance data directly into R
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yahoo <- function(s) read.csv(file=paste('http://ichart.finance.yahoo.com/table.csv?s=',s,'&c=1900&f=2012&g=d',sep='')); | |
ticker = 'AAPL' | |
dat = yahoo(ticker); | |
plot(main=ticker, xlab='date', ylab='close price', | |
as.Date(dat$Date),dat$Adj.Close,type='l',log='y'); | |
grid(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment