monthplot               package:stats               R Documentation

_P_l_o_t _a _S_e_a_s_o_n_a_l _o_r _o_t_h_e_r _S_u_b_s_e_r_i_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     These functions plot seasonal (or other) subseries of a time
     series. For each season (or other category), a time series is
     plotted.

_U_s_a_g_e:

     monthplot(x, labels = NULL, times, phase, base, choice, ...)

_A_r_g_u_m_e_n_t_s:

       x: Time series or related object.

  labels: Labels to use for each "season".

   times: Time of each observation.

   phase: Indicator for each "season".

    base: Function to use for reference line for subseries.

  choice: Which series of an 'stl' or 'StructTS' object?

     ...: Graphical parameters.

_D_e_t_a_i_l_s:

     These functions extract subseries from a time series and plot them
     all in one frame.  The 'ts', 'stl', and 'StructTS' methods use the
     internally recorded frequency and start and finish times to set
     the scale and the seasons.  The default method assumes
     observations come in groups of 12 (though this can be changed).

     If the 'labels' are not given but the 'phase' is given, then the
     'labels' default to the unique values of the 'phase'.  If both are
     given, then the 'phase' values are assumed to be indices into the
     'labels' array, i.e., they should be in the range from 1 to
     'length(labels)'.

_V_a_l_u_e:

     These functions are executed for their side effect of drawing a
     seasonal subseries plot on the current graphical window.

_A_u_t_h_o_r(_s):

     Duncan Murdoch

_R_e_f_e_r_e_n_c_e_s:

     Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) _The New S
     Language_. Wadsworth & Brooks/Cole.

_S_e_e _A_l_s_o:

     'ts', 'stl', 'StructTS'

_E_x_a_m_p_l_e_s:

     ## The CO2 data
     data(co2)
     fit <- stl(log(co2), s.window = 20, t.window = 20)
     plot(fit)
     op <- par(mfrow = c(2,2))
     monthplot(co2, ylab = "data", cex.axis = 0.8)
     monthplot(fit, choice = "seasonal", cex.axis = 0.8)
     monthplot(fit, choice = "trend", cex.axis = 0.8)
     monthplot(fit, choice = "remainder", type = "h", cex.axis = 0.8)
     par(op)

     ## The CO2 data, grouped quarterly
     quarter <- (cycle(co2) - 1) %/% 3
     monthplot(co2, phase = quarter)

     ## see also JohnsonJohnson

