Re: [R] Log difference in a dataframe column

2011-01-18 Thread Bill.Venables
08 PM To: r-help@r-project.org Subject: Re: [R] Log difference in a dataframe column Just learning so excuse me if I'm being too basic here. But I'm wondering how should I know that as.ts would be needed for lag ? Is there a thought process or way to inspect that I should have gone throug

Re: [R] Log difference in a dataframe column

2011-01-18 Thread eric
Just learning so excuse me if I'm being too basic here. But I'm wondering how should I know that as.ts would be needed for lag ? Is there a thought process or way to inspect that I should have gone through to know that log would work on y[,5] but lag would not work on [,5] ? Is the general rule

Re: [R] Log difference in a dataframe column

2011-01-17 Thread Peter Ehlers
On 2011-01-17 07:44, eric wrote: What am I doing wrong here ? And what's the right way to calculate the log differences in a column in a df ? # first 3 rows of 5000 rows y[1:3,] Date Open High Low Close 1 1983-03-30 29.96 30.51 29.96 30.35 2 1983-03-31 30.35 30.55 30.20 30.24 3 1983-04-0