buysbal {pastecs} | R Documentation |
Buys-Ballot table
Description
Calculate a Buys-Ballot table from a time-series
Usage
buysbal(x, y=NULL, frequency=12, units="years", datemin=NULL,
dateformat="m/d/Y", count=FALSE)
Arguments
x |
Either a vector with time values (in this case, |
y |
If |
frequency |
The frequency of observations per year to use in the Buys-Ballot table. By default |
units |
either |
datemin |
A character string representing the first date, using a format corresponding to |
dateformat |
The format used for the date in |
count |
If |
Details
A Buys-Ballot table summarizes data to highlight seasonal variations. Each line is one year and each column is a period of the year (12 months, 4 quarters, 52 weeks,...). A cell ij of this table contain the mean value for all observations made during the year i at the period j.
Value
A matrix containing either the Buys-Ballot table (count=FALSE
), or the number of observations used to build the table (count=TRUE
)
Author(s)
Frédéric Ibanez (ibanez@obs-vlfr.fr), Philippe Grosjean (phgrosjean@sciviews.org)
See Also
Examples
data(releve)
buysbal(releve$Day, releve$Melosul, frequency=4, units="days",
datemin="21/03/1989", dateformat="d/m/Y")
buysbal(releve$Day, releve$Melosul, frequency=4, units="days",
datemin="21/03/1989", dateformat="d/m/Y", count=TRUE)