listw2sn                package:spdep                R Documentation

_S_p_a_t_i_a_l _n_e_i_g_h_b_o_u_r _s_p_a_r_s_e _r_e_p_r_e_s_e_n_t_a_t_i_o_n

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

     The function makes a '"spatial neighbour"' object representation
     (similar to the S-PLUS spatial statististics module representation
     of a '"listw"' spatial weights object. 'sn2listw()' is the inverse
     function to 'listw2sn()', creating a '"listw"' object from a
     '"spatial neighbour"' object. The 'as.spam.listw' method converts
     a '"listw"' object to a sparse matrix as defined in the 'spam'
     package, using 'listw2sn()'.

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

     listw2sn(listw)
     sn2listw(sn)
     as.spam.listw(listw)

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

   listw: a 'listw' object from for example 'nb2listw'

      sn: a 'spatial.neighbour' object

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

     'listw2sn()'returns a data frame with three columns, and with
     class 'spatial.neighbour': 

    from: region number id for the start of the link (S-PLUS row.id)

      to: region number id for the end of the link (S-PLUS col.id)

 weights: weight for this link

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

     Roger Bivand Roger.Bivand@nhh.no

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

     'nb2listw'

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

     example(columbus)
     col.listw <- nb2listw(col.gal.nb)
     col.listw$neighbours[[1]]
     col.listw$weights[[1]]
     col.sn <- listw2sn(col.listw)
     str(col.sn)
     col.sp <- as.spam.listw(col.listw)
     str(col.sp)

