[R-SIG-Finance] digits and as.perc arguments in table.Arbitrary inPerformanceAnalytics
Frank
frankm60606 at gmail.com
Thu Aug 15 02:06:31 CEST 2013
Maybe you need round()? Your post seems to be all character strings, not
sure what I am missing. Assume that the first argument to round() is a
number:
round((Return_annualized,1))
will round Return_annualized to one digit. You can then paste that with a
label if you want.
round(100*Max_Draw_down,1)
If your MaxDrawdown is actually 0.552 and you want 55.2.
Thanks,
Frank
Chicago
________________________________________
From: r-sig-finance-bounces at r-project.org
[mailto:r-sig-finance-bounces at r-project.org] On Behalf Of HAKAN KAYA
Sent: Wednesday, August 14, 2013 6:00 PM
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] digits and as.perc arguments in table.Arbitrary
inPerformanceAnalytics
Hi,
Is there anyway to pass through digits and as.perc in the function
table.Arbitrary?
For example, when I run the below line, the output by default gives lots of
digits.
table.Arbitrary(Ret,metrics=c("Return.annualized","StdDev.annualized","Sharp
eRatio.annualized","maxDrawdown"),metricsNames=c("Return
(Annualized)","StDev (Annualized)","Sharpe Ratio
(Annualized)","MaxDrawdown"))
SPY IEF
Return (Annualized) 0.04949007 0.06293099
StDev (Annualized) 0.23882840 0.07807295
Sharpe Ratio (Annualized) 0.20722021 0.80605368
MaxDrawdown 0.55193114 0.10404821
It would be nice if we could round the numbers and show some of them as
percentages and some of them as numbers.
A desired output for example can be
SPY IEF
Return (Annualized) 4.9 6.3
StDev (Annualized) 23.9 7.8
Sharpe Ratio (Annualized) 0.21 0.81
MaxDrawdown 55.2 10.4
Thanks,
Hakan
________________________________________
daimi e-posta adresiniz ---> http://www.postamatik.com
More information about the R-SIG-Finance
mailing list