getdata {atmi} | R Documentation |
Get the daily finance data for the desired period from http://finance.yahoo.com/
.
getdata(symbol = FALSE, period = c(startdate = FALSE, enddate = FALSE))
symbol |
a unique series of letters assigned to a security for trading purposes. You can get the symbols by using the function getsymbols or from http://finance.yahoo.com/ . If FALSE, a datamatrix is needed.
|
period |
is a vector of start and end dates, in "YYYY-MM-DD" format. If the startdate is FALSE, all available data until the enddate will be used. If the enddate is FALSE, all available data from the startdate will be used. If both are FALSE, all available data will be used.
|
datamatrix |
a matrix object with the following columns::
|
To run the function, an active Internet connection is required.
The last column Adj.Close
of the returned matrix datamatrix
provides the closing price adjusted for all applicable splits and dividend distributions.
Waldemar Kemler, Peter Schaffner
# Returns data for "AACC" for whole available period. datamat<-getdata("AACC") # Returns data for "AACC" for the period from 2008-01-01 through 2008-12-31. datamat<-getdata("AACC", period=c("2008-01-01","2008-12-31")) # Returns all available data for "AACC" until 12/31/08. datamat<-getdata("AACC", period=c(FALSE,"2008-12-31")) # Returns all available data from 01/01/08. With the usage of function "getsymbols". symbol<-getsymbols("DJI") datamat<-getdata(symbol[1], period=c("2008-01-01",FALSE)) datamat