sinusoid: Plot a sinusoid

Description Usage Arguments Details Author(s) References Examples

View source: R/sinusoid.R

Description

Plots a sinusoid over 0 to 2π.

Usage

1
sinusoid(amplitude, frequency, phase, ...)

Arguments

amplitude

the amplitude of the sinsuoid (its maximum value).

frequency

the frequency of the sinusoid in 0 to 2π (number of cycles).

phase

the phase of the sinusoid (location of the peak).

...

additional arguments passed to the plot.

Details

Sinusoidal curves are very useful for modelling seasonal data. A sinusoid is plotted using the equation: A\cos(ft-P), t=0,…,2 π, where A is the amplitude, f is the frequency, t is time and P is the phase.

Author(s)

Adrian Barnett a.barnett<at>qut.edu.au

References

Barnett, A.G., Dobson, A.J. (2010) Analysing Seasonal Health Data. Springer.

Examples

1
sinusoid(amplitude=1, frequency=1, phase=1)

Example output

Loading required package: ggplot2
Loading required package: MASS
Loading required package: survival

season documentation built on May 2, 2019, 5:22 p.m.