[R-SIG-Finance] digits and as.perc arguments in table.Arbitrary in PerformanceAnalytics

Peter Carl peter at braverock.com
Thu Aug 15 01:16:04 CEST 2013


Text-only emails are preferred on this list.  In fact, I'm not sure R code
will run if it's typed in comic sans.

But to get to the core question, no.  There's no way to anticipate which
numbers need to be formatted which way in that particular function.  You
can take a look at Hmisc::format.df, which does the job once you know what
you want.  There's probably an example in textplot or one of the other
table.* functions.

pcc
-- 
Peter Carl
http://www.braverock.com/peter

> <DIV style="font-family:Comic Sans MS, cursive; font-size:12pt;"><FONT
> face="Comic Sans MS, cursive">Hi,</FONT><DIV><FONT face="Comic Sans MS,
> cursive"><BR></FONT></DIV><DIV><FONT face="Comic Sans MS, cursive">Is
> there anyway to pass through digits and as.perc in the function
> table.Arbitrary?</FONT></DIV><DIV><FONT face="Comic Sans MS, cursive">For
> example, when I run the below line, the output by default gives lots of
> digits.</FONT></DIV><DIV><FONT face="Comic Sans MS,
> cursive"><BR></FONT></DIV><DIV><FONT face="Comic Sans MS,
> cursive"><DIV>table.Arbitrary(Ret,metrics=c("Return.annualized","StdDev.annualized","SharpeRatio.annualized","maxDrawdown"),metricsNames=c("Return
> (Annualized)","StDev (Annualized)","Sharpe Ratio
> (Annualized)","MaxDrawdown"))</DIV><DIV>         
>                    
>            SPY      
>  IEF</DIV><DIV>Return (Annualized)          
> 0.04949007 0.06293099</DIV><DIV>StDev (Annualized)      
>      0.23882840 0.07807295</DIV><DIV>Sharpe Ratio
> (Annualized)  0.20722021 0.80605368</DIV><DIV>MaxDrawdown  
>                 0.55193114
> 0.10404821</DIV><DIV><BR></DIV><DIV>It would be nice if we could round the
> numbers and show some of them as percentages and some of them as
> numbers.</DIV><DIV>A desired output for example can
> be</DIV><DIV><DIV>               
>                    
>   SPY        IEF</DIV><DIV>Return (Annualized)
>          4.9    6.3</DIV><DIV>StDev
> (Annualized)           23.9
>  7.8</DIV><DIV>Sharpe Ratio (Annualized) 0.21
> 0.81</DIV><DIV>MaxDrawdown            
>      55.2
>  10.4</DIV></DIV><DIV><BR></DIV><DIV>Thanks,</DIV><DIV>Hakan</DIV><DIV><BR></DIV><DIV><BR></DIV></FONT></DIV><BR> <BR><HR>daimi
> e-posta adresiniz --->
> http://www.postamatik.com</DIV>_______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.



More information about the R-SIG-Finance mailing list