addBoundary            package:Rcartogram            R Documentation

_E_m_b_e_d _m_a_t_r_i_x _w_i_t_h_i_n _l_a_r_g_e_r _m_a_t_r_i_x

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

     This function is useful for taking the grid of  densities/counts
     as a matrix and embedding it in a larger matrix whose additional
     values are just the mean of our original matrix. This new matrix
     can then be handed to 'cartogram' to fit the  diffusion cartogram.
     The extra "padding" or "sea" helps the algorithm converge.

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

     addBoundary(pop, sea = 0.2)

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

     pop: the matrix of densities/counts to be embedded.

     sea: a number which is applied to the dimensions of the original
          matrix to determine how many rows and columns should be added
          to the original matrix. Twice as many rows and columns are
          added as this product, an equal number of rows above and
          below, and an equal  number of columns to the left and to the
          right. 

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

     A matrix with dimension ' floor((1 + 2 * seq) * dim(pop)) ' and
     whose "outer" values in the added rows is the mean of  the
     original matrix 'pop'.

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

     Duncan Temple Lang created the interface for R

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

     "Diffusion-based method for producing density equalizing maps", 
     Michael T. Gastner and M. E. J. Newman, Proc. Natl. Acad. Sci. USA
     101, 7499-7504 (2004) <URL:
     http://www.pnas.org/cgi/content/abstract/101/20/7499>

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

     'cartogram'

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

      m = matrix(1, 5, 7)
      mm = col(m)

      ex = addBoundary(mm)
      dim(ex)
      image(ex)

      ex = addBoundary(mm, 1)
      dim(ex)

