Skip to content
Prev 15119 / 15274 Next

Performanceanalytics Charts - removing default date in title?

Hi Ed,

It's not helpful to give an answer you're not sure is correct.
Especially from ChatGPT, which is known to confidently give wrong
answers. And that's what it did in this case. There are at least two
issues:

1. "chart.CumReturns.custom is a copy of the chart.CumReturns
function" is false.
The definition of chart.CumReturns.custom() isn't even close to the
definition of chart.CumReturns() in PerformanceAnalytics version
2.0.4. You can find the actual chart.CumReturns() code on GitHub:
https://github.com/braverock/PerformanceAnalytics/blob/691961b6a9d97cbc9c0660431f7bf0e9884cf03d/R/chart.CumReturns.R#L42

2. The code you pasted throws an error. You could have run the code
yourself to see if it was correct.
    i. The 'returns' object can't be converted to xts, which causes an error
    ii. It errors even if you make 'returns' an xts object because it
uses `class(x) == "numeric"` (which the real function does not)

There's already enough noise in time series data. We don't need
ChatGPT adding even more noise. ;-)

Regards,
Josh
On Mon, May 22, 2023 at 10:47?PM Ed Herranz <ed.herranz at gmail.com> wrote: