[R-SIG-Finance] R - Error Question for chart.Correlation(PerformanceAnalytics)

Peter Carl peter at braverock.com
Tue Jan 8 18:39:40 CET 2008


On Tuesday 08 January 2008 10:08:06 am Guy Yollin wrote:
> Also, it appears that a couple of the datasets (managers and edhec) have
> what should really be the rownames as the first column of data in the
> dataframe.

Can you clarify this?  How are you loading the data?  The examples, which are 
all run (tested) as part of the submission to CRAN, simply load the data 
using: 

> data(managers)
> head(managers)
            HAM1 HAM2    HAM3    HAM4 HAM5 HAM6 EDHEC.LS.EQ SP500.TR US.10Y.TR
Jan 1996  0.0100   NA  0.0359  0.0208   NA   NA          NA   0.0340   0.00380
Feb 1996  0.0215   NA  0.0295  0.0231   NA   NA          NA   0.0093  -0.03532
Mar 1996  0.0226   NA  0.0253 -0.0053   NA   NA          NA   0.0096  -0.01057
Apr 1996  0.0008   NA  0.0478  0.0200   NA   NA          NA   0.0147  -0.01739
May 1996  0.0158   NA  0.0337  0.0122   NA   NA          NA   0.0258  -0.00543
Jun 1996 -0.0086   NA -0.0293 -0.0089   NA   NA          NA   0.0038   0.01507
         US.3m.TR
Jan 1996  0.00456
Feb 1996  0.00398
Mar 1996  0.00371
Apr 1996  0.00428
May 1996  0.00443
Jun 1996  0.00412

If you use read.csv, you'll want to set row.names=1 so to capture the 
appropriate label.

Also, these data objects are now zoo objects and degrade nicely with as.matrix 
and other similar functions.

pcc
-- 
Peter Carl
145 Scottswood Rd
Riverside, IL 60546
708 447 6465



More information about the R-SIG-Finance mailing list