dathomog                package:seas                R Documentation

_H_o_m_o_g_e_n_i_z_e _d_a_i_l_y _d_a_t_a _s_e_t_s

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

     Homogenizes daily data from two data sets into one data set;
     optionally show cross-plots to examine how well correlated that
     data sets are.

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

     dathomog(x1, x2, by = "date", plot = FALSE)

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

      x1: a 'data.frame' of seasonal data; 1st selection

      x2: a 'data.frame' or seasonal data; 2nd selection

      by: name of common column, usually 'date', which is of class
          'Date'

    plot: 'logical'; produce cross-plots and correlation statistics of
          the variables between the two data sets

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

     Data from 'x1' has priority over 'x2'.  Where data from 'x1' is
     either 'NA' or missing (outside of time range), data from 'x2'
     will be used (if available). Otherwise data form 'x1' will be used
     directly. Variables will be homogenized where their names are
     identical, found using 'names'.

     The cross-plots of the data are shown only for interest. They show
     useful correlation statistics, and a best-fit line using
     perpendicular offsets (which are preferred in this case over
     traditional linear regression). At some point, the equations for
     this line may be used to adjust the values from 'x2', however this
     can always be done externally to this function by pre-processing
     'x2'.

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

     Returns a 'data.frame' of seasonal data required by most functions
     in 'seas'. Variable names of the structure are found by a 'union'
     of the names of 'x1' and 'x2'.

_W_a_r_n_i_n_g:

     Weather stations should be sufficiently close enough to
     approximate the same weather. This distance depends on the spatial
     distance and local climatology.

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

     M.W. Toews

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


     http://mathworld.wolfram.com/LeastSquaresFittingPerpendicularOffsets.html

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

     data(mscdata)
     dat1 <- mksub(mscdata,id=2100630)
     dat2 <- mksub(mscdata,id=1108447)
     plot.year(dat1)
     plot.year(dat2)
     newdata <- dathomog(dat1,dat2)
     plot.year(newdata)
     message(paste(c("This is a rather poor example, since the",
                     "two stations are nowhere near each other"),
                     collapse="\n"))

