Skip to content

chart.PerformanceAnalytics(), character string is not in a standard unambiguous format

4 messages · Khanh Nguyen, Brian G. Peterson, Peter Carl

#
Hi all,

I ran into this error "Error in fromchar(x) : character string is not
in a standard unambiguous format"" when I run
charts.PerformanceSummary(). I guess that I probably messed up the
dates in my data somehow.
STB
Aug 2006  0.01250428
Sep 2006  0.05904603
Oct 2006 -0.05970026
Nov 2006  0.05846646
Dec 2006  0.09671211
Jan 2007  0.26135075
structure(c(0.0125042761200924, 0.059046028746296, -0.0597002649488925,
0.0584664584999639, 0.0967121147037853, 0.261350754509795, 0.084761454787754,
0.281618134192335, -0.050301925509296, 0.127002576668413, -0.229431460030798,
-0.191458836140774, -0.0185289083290332, 0.268858114855369,
-0.0363007156717821,
0.0147123648065453, -0.0448028245368759, -0.0153917235834742,
-0.225195932349637, -0.327933538473546, -0.102059501725719, -0.313061498255964,
-0.112165043352160, 0.214704682668345, 0.269509471872135, -0.261070603226270,
-0.0877756108823857, -0.0811901547300131, -0.0883691504500903,
-0.0501497836854714, -0.167573700159399, 0.090384061468269, 0.259511195485085,
0.232622295268754, 0.360441426734209), .Dim = c(35L, 1L), .Dimnames = list(
    c("Aug 2006", "Sep 2006", "Oct 2006", "Nov 2006", "Dec 2006",
    "Jan 2007", "Feb 2007", "Mar 2007", "Apr 2007", "May 2007",
    "Jun 2007", "Jul 2007", "Aug 2007", "Sep 2007", "Oct 2007",
    "Nov 2007", "Dec 2007", "Jan 2008", "Feb 2008", "Mar 2008",
    "Apr 2008", "May 2008", "Jun 2008", "Jul 2008", "Aug 2008",
    "Sep 2008", "Oct 2008", "Nov 2008", "Dec 2008", "Jan 2009",
    "Feb 2009", "Mar 2009", "Apr 2009", "May 2009", "Jun 2009"
    ), "STB"), index = structure(c(2006.58333333333, 2006.66666666667,
2006.75, 2006.83333333333, 2006.91666666667, 2007, 2007.08333333333,
2007.16666666667, 2007.25, 2007.33333333333, 2007.41666666667,
2007.5, 2007.58333333333, 2007.66666666667, 2007.75, 2007.83333333333,
2007.91666666667, 2008, 2008.08333333333, 2008.16666666667, 2008.25,
2008.33333333333, 2008.41666666667, 2008.5, 2008.58333333333,
2008.66666666667, 2008.75, 2008.83333333333, 2008.91666666667,
2009, 2009.08333333333, 2009.16666666667, 2009.25, 2009.33333333333,
2009.41666666667), class = "yearmon"), class = "zoo")
Error in fromchar(x) :
  character string is not in a standard unambiguous format


Thanks.

-k
#
Is your date index a Date class, or a character string?  If it is of 
class Date or YearMon, I wouldn't anticipate any problems, but if your 
row names are characters, the error would be because the charting 
function doesn't know how to create the x axis labels.

For example, as.xts(z) would likely give you the same error if you have 
character strings for the dates.

Regards,

    - Brian
Khanh Nguyen wrote:
<...>
#
Try:
That should revert your dates into a standard %F ISO-standard format.

Should be fixed in the next release.  Sorry for the inconvenience.

pcc
#
Hi all,

Thank you very much for all the help. Really appreciate it.
On Wed, Jun 17, 2009 at 5:21 PM, Peter Carl<peter at braverock.com> wrote:
this still doesn't do it. But finally I got my way. in case others
experience the same problem, this is what I do
# I dont know why, but without the above I get an errors, and only one
chart is printed instead of 3
# like the one here
http://cran.r-project.org/web/packages/PerformanceAnalytics/vignettes/PA-charts.pdf,
page 9,
# > charts.PerformanceSummary(newx)
# Error in FUN(newX[, i], ...) : The selected column is not numeric
# In addition: Warning message:
# In max(i) : no non-missing arguments to max; returning -Inf
Cheers,

-k