getSectorComp: getSectorComp

Description Usage Arguments Value See Also Examples

Description

get the components of the specific sector on certain day.

Usage

1
2
getSectorComp(sectorID, endT = Sys.Date(), drop = TRUE,
  datasrc = defaultDataSRC())

Arguments

sectorID

ID of the sector. eg. "ES09440000" for "financial service" the 1st level sector of SHENWAN; "ES09440100" for "bank" the 2nd level sector of SHENWAN. Get details with CT_industryList()

endT

a vector of class Date. IF missing, then get the latest components.

drop

if drop the field of date and return a vector when endT is length 1 ?

Value

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"

See Also

Other getComps functions: getComps, getIndexCompWgt

Examples

1
2
3
tmp <- getSectorComp("ES09440000") # get the latest components, a vector
tmp <- getSectorComp("ES09440000",as.Date("2012-12-31")) # get the components on single day,a vector
tmp <- getSectorComp("ES09440000",as.Date(c("2011-12-31","2012-12-31"))) # get the components on multi-days, a data frame

QuantAndrew/QDataGet documentation built on May 14, 2019, 7:35 a.m.