Learn R Programming

peacots (version 1.0)

plotReport: Plot results of a evaluate.pm analysis

Description

Create a simple plot of a time series and the results of a evaluate.pm analysis (including the periodogram and the fitted OUSS power spectrum).

Usage

plotReport(name="", times=NULL, signal=NULL, 
           report=NULL, plotFile=NULL, dataFile=NULL, sep=" ")

Arguments

name
Character. A short name for the time series to be used for the plots (e.g. 'long-term study' or 'hare population').
times
Numeric vector. The time points of the time series used for the analysis. Set to NULL to not plot the time series.
signal
Numeric vector. The time series values (signal) used for the analysis. Set to NULL to not plot the time series.
report
The value returned by evaluate.pm. This is a list with the periodogram analysis results. Set to NULL to not plot any analysis results.
plotFile
An optional path to a PDF file to be generated with the plot.
dataFile
An optional path to a data file for storing the time series and the results of the analysis.
sep
Separator to be used for the data file. Only relevant if dataFile is not NULL.

References

Louca, S., Doebeli, M. - Detecting cyclicity in ecological time series (in review, as of June 2014)

See Also

evaluate.pm

Examples

Run this code
# generate cyclic time series by adding a periodic signal to an OUSS process
times  = seq(0,20,0.2);
signal = 0.75 * cos(2*pi*times) + generate_ouss(times, mu=0, sigma=1, lambda=1, epsilon=0.5);

# find periodogram peak and estimate statistical significance
report = evaluate.pm(times=times, signal=signal, minPeakFreq=0.3, minFitFreq=0.3);

# plot overview of periodogram peak analysis
plotReport(sprintf("Example"), times=times, signal=signal, report=report);

Run the code above in your browser using DataLab