Re: [R] One year return not year to date

2020-07-26 Thread Rasmus Liland
Hello, On 2020-07-25 20:05 +0100, Rui Barradas wrote: > Às 19:06 de 25/07/2020, Bert Gunter escreveu: > > On Sat, Jul 25, 2020 at 8:41 AM Pedro páramo wrote: > > > Hi all, > > > > > > I want to calculate interanual > > > (not year to date) variation of a > > > stock, I am able to obtain year t

Re: [R] One year return not year to date

2020-07-25 Thread Rui Barradas
Hello, I believe the error message comes from the last line, getQuote returns a data.frame with a Date column and log(aaa) will try to log a date. Error. log(aaa[-1]) works, maybe the OP wants to revise the code and then come back to this or other thread. Hope this helps, Rui Barradas Às 1

Re: [R] One year return not year to date

2020-07-25 Thread Bert Gunter
What is the error message? Knowing this may help others diagnose the problem. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Jul 25, 2020 at 8:41 AM Pedro

[R] One year return not year to date

2020-07-25 Thread Pedro páramo
Hi all, I want to calculate interanual (not year to date) variation of a stock, I am able to obtain year to date with annualReturn, but no way to obtain the interanual increase. It says me no numerical output. Can anyone guide me to obtain it. library(PerformanceAnalytics) library(dplyr) library