nb.set.operations           package:spdep           R Documentation

_S_e_t _o_p_e_r_a_t_i_o_n_s _o_n _n_e_i_g_h_b_o_r_h_o_o_d _o_b_j_e_c_t_s

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

     Set operations on neighbors list objects

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

     intersect.nb(nb.obj1,nb.obj2)
     union.nb(nb.obj1,nb.obj2)
     setdiff.nb(nb.obj1,nb.obj2)
     complement.nb(nb.obj)

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

  nb.obj: a neighbor list created from any of the neighborhood list
          funtions

 nb.obj1: a neighbor list created from any of the neighborhood list
          funtions

 nb.obj2: a neighbor list created from any of the neighborhood list
          funtions

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

     These functions perform set operations on each element of a
     neighborlist. The arguments must be neighbor lists created from
     the same coordinates, and the region.id attributes must be
     identical.

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

  nb.obj: A new neighborlist created from the set operations on the
          input neighbor list(s)

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

     Nicholas Lewin-Koh nikko@hailmail.net

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

     'intersect.nb', 'union.nb', 'setdiff.nb'

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

     example(columbus)
     coords <- coordinates(columbus)
     col.tri.nb <- tri2nb(coords)
     oldpar <- par(mfrow=c(1,2))
     col.soi.nb <- graph2nb(soi.graph(col.tri.nb, coords))
     plot(columbus, border="grey")
     plot(col.soi.nb, coords, add=TRUE)
     title(main="Sphere of Influence Graph")
     plot(columbus, border="grey")
     plot(complement.nb(col.soi.nb), coords, add=TRUE)
     title(main="Complement of Sphere of Influence Graph")
     par(mfrow=c(2,2))
     col2 <- droplinks(col.gal.nb, 21)
     plot(intersect.nb(col.gal.nb, col2), coords)
     title(main="Intersect")
     plot(union.nb(col.gal.nb, col2), coords)
     title(main="Union")
     plot(setdiff.nb(col.gal.nb, col2), coords)
     title(main="Set diff")
     par(oldpar)

