Skip to content
Prev 155532 / 398502 Next

Help with 'spectrum'

This is why some help pages have references: please use them (Venables & 
Ripley explain the exact formulae used in R).
On Tue, 9 Sep 2008, rkevinburton at charter.net wrote:

            
So please do look up the help for frequency().
The point is that your time unit is 1 year, and your measurements are 
every 1/365 year.  That is unrelated to the 'period' (no one mentioned 
periodicity yet).
Hmm, you need a 't' in there (and a phase).  The issue is the units for t. 
A frequency in the 'freq' element of the output of 0.1 corresponds to 10 
cycles per unit of time, and in your example the unit of time is 365 
observations.  So the sine (sic) wave is sin(2*pi*0.1*t + phi), where the 
increments in 't' are 1/365: that gives 10 complete cycles in observations 
at, say, c(1990, 1) ... c(1990, 365), the days of 1990 (not a leap year).