sunspot                  package:ts                  R Documentation

_Y_e_a_r_l_y _S_u_n_s_p_o_t _D_a_t_a, _1_7_0_0-_1_9_8_8, _a_n_d
_M_o_n_t_h_l_y _S_u_n_s_p_o_t _D_a_t_a, _1_7_4_9-_1_9_9_7

_D_e_s_c_r_i_p_t_i_o_n:

     Monthly and yearly number of sunspots.

_U_s_a_g_e:

     data(sunspot)

_F_o_r_m_a_t:

     The univariate time series 'sunspot.year' and 'sunspot.month'
     contain 289 and 2988 observations, respectively. The objects are
     of class '"ts"'.

_S_o_u_r_c_e:

     Monthly data: Sunspot Index Data Center, World Data Center-C1 For
     Sunspot Index Royal Observatory of Belgium, Av. Circulaire, 3,
     B-1180 BRUSSELS <URL:
     http://www.oma.be/KSB-ORB/SIDC/sidc_txt.html>

     Yearly data: H. Tong (1996) _Non-Linear Time Series_. Clarendon
     Press, Oxford, p. 471.

_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:

     'sunspot.month' is a longer version of 'sunspots' in base R, that
     runs until 1988.

_E_x_a_m_p_l_e_s:

     ## Compare the monthly series from 'base' and 'ts':
     data(sunspots, package = base)
     data(sunspot,  package = ts)
     plot (sunspot.month, main = "sunspot.month [ts]", col = 2)
     lines(sunspots) # "very barely" see something

     ## Now look at the difference :
     all(tsp(sunspots)     [c(1,3)] ==
         tsp(sunspot.month)[c(1,3)]) ## Start & Periodicity are the same
     n1 <- length(sunspots)
     table(eq <- sunspots == sunspot.month[1:n1]) #>  132  are different !
     i <- which(!eq) 
     rug(time(eq)[i])
     s1 <- sunspots[i] ; s2 <- sunspot.month[i]
     cbind(i = i, sunspots = s1, ss.month = s2,
           perc.diff = round(100*2*abs(s1-s2)/(s1+s2), 1))

