Description Usage Arguments Value See Also Examples
get the components of the specific index, sector or plate on certain days.
1 | getComps(ID, endT = Sys.Date(), drop = TRUE, datasrc = defaultDataSRC())
|
ID |
a character string. The ID of the index, sector or plate. Could be a single-ID-code(eg. "EI000300","ES09440000",...) or a more complicated express containing some set operations and ID-codes(eg. "setdiff(union(EI000300,EI000905),ES09440000)") |
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"
Other getComps functions: getIndexCompWgt
,
getSectorComp
1 2 3 4 5 6 7 8 9 10 11 | re1 <- getComps("EI000300") # same as getIndexComp("EI000300")
ID <- "setdiff(union(EI000300,EI399006),ES09440000)"
re2 <- getComps(ID)
re3 <- getComps(ID,endT=as.Date(c("2011-12-31","2012-12-31")))
more examples:
# CSI300 ex. financial servive sector
getComps("setdiff(EI000300,ES09440000)")
# CSI300 and financial servive sector
getComps("intersect(EI000300,ES09440000)")
# not drop
getComps("EI000300",drop=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.