Description Usage Arguments Value Author(s) See Also Examples
get financial factorscore via rptTS
1 | TS.getFin_by_rptTS(TS, fun, ...)
|
fun |
a function or a non-empty character string naming the function to be called, which get the financtial indicators from rptTS. Note that the function must contain a param of 'rptTS' . |
... |
optional arguments except rptTS of fun. |
a dataframe with the same length with TS, but added by some other financial indicator fields.
Ruifei.Yin
rptTS.getFin_windR
, rptTS.getFin_ts
1 2 3 4 5 6 7 8 9 | TS <- Model.TS(modelPar.univ(indexID="ES09440000"))
re <- TS.getFin_by_rptTS(TS,fun="rptTS.getFin_windR",field="np_belongto_parcomsh","rptType=1")
re2 <- TS.getFin_by_rptTS(TS,fun="rptTS.getFin_ts",funchar='"np_belongto_parcomsh",report(46078,RDate)')
# -- Following is a speed comparison of three different methods to get financial factorscores:
TS <- Model.TS(setmodelPar.time(modelPar.default(),begT=as.Date("2007-12-01"),endT=as.Date("2014-05-01")))
system.time(re.wind <- TS.getFin_by_rptTS(TS,fun="rptTS.getFin_windR",field="np_belongto_parcomsh","rptType=1")) # 73.69
system.time(re.ts_dir <- TS.getFin_ts(TS,funchar='report(46078,RDate)',varname="np_belongto_parcomsh")) # 12.49
system.time(re.ts_rpt <- TS.getFin_by_rptTS(TS,fun="rptTS.getFin_ts",funchar='"np_belongto_parcomsh",report(46078,RDate)')) # 6.29
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.