spChFIDs-methods          package:maptools          R Documentation

_c_h_a_n_g_e _f_e_a_t_u_r_e _I_D_s _i_n _s_p_a_t_i_a_l _o_b_j_e_c_t_s

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

     When the feature IDs need to be changed in SpatialLines* or
     SpatialPolygons* objects, these methods may be used. The new IDs
     should be a character vector of unique IDs of the correct length.

_M_e_t_h_o_d_s:



     _o_b_j = "_S_p_a_t_i_a_l_L_i_n_e_s", _x = "_c_h_a_r_a_c_t_e_r" replace IDs in a
          SpatialLines object

     _o_b_j = "_S_p_a_t_i_a_l_L_i_n_e_s_D_a_t_a_F_r_a_m_e", _x = "_c_h_a_r_a_c_t_e_r" replace IDs in a
          SpatialLinesDataFrame object

     _o_b_j = "_S_p_a_t_i_a_l_P_o_l_y_g_o_n_s", _x = "_c_h_a_r_a_c_t_e_r" replace IDs in a
          SpatialPolygons object

     _o_b_j = "_S_p_a_t_i_a_l_P_o_l_y_g_o_n_s_D_a_t_a_F_r_a_m_e", _x = "_c_h_a_r_a_c_t_e_r" replace IDs in a
          SpatialPolygonsDataFrame object

_N_o_t_e:

     It is usually sensible to keep a copy of the original feature IDs
     in the object, but this should be done by the user.

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

     Roger Bivand

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

     'spCbind-methods', 'spRbind-methods'

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

     xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], 
       IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
     row.names(as(xx, "data.frame"))
     xx1 <- spChFIDs(xx, as.character(xx$CNTY_ID))
     row.names(as(xx1, "data.frame"))

