Description Usage Arguments Value Examples
get the components of the specific index on certain day.
1 2 | getIndexComp(indexID, endT = Sys.Date(), drop = FALSE,
datasrc = defaultDataSRC())
|
indexID |
the stockID of the index |
endT |
a vector of class |
drop |
if drop the field of date and return a vector when endT is length 1 ? |
If endT
is missing or is length 1 and drop
is TRUE, a vector of stockID of the components; else a dataframe, with cols: "date" and "stockID"
1 2 3 4 5 | tmp <- getIndexComp("EI000300",drop=TRUE) # get the latest components, a vector
tmp <- getIndexComp("EI000300") # get the latest components, a dataframe
tmp <- getIndexComp("EI000300",as.Date("2012-12-31")) # get the components on single day,a vector
tmp <- getIndexComp("EI000300",as.Date(c("2011-12-31","2012-12-31"))) # get the components on multi-days, a data frame
tmp <- getIndexComp("EI000300",as.Date(c("2005-12-31","2012-12-31"))) # get the components before index's pubdate, a data frame
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.