SpatialRingsDataFrame-class        package:sp        R Documentation

_C_l_a_s_s "_S_p_a_t_i_a_l_R_i_n_g_s_D_a_t_a_F_r_a_m_e"

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

     class to hold polygons with attributes

_O_b_j_e_c_t_s _f_r_o_m _t_h_e _C_l_a_s_s:

     Objects can be created by calls to the function
     SpatialRingsDataFrame

_S_l_o_t_s:

     '_d_a_t_a': Object of class '"data.frame"'; attribute table 

     '_p_o_l_y_g_o_n_s': Object of class '"list"'; see SpatialRings-class 

     '_p_l_o_t_O_r_d_e_r': Object of class '"integer"'; see SpatialRings-class 

     '_b_b_o_x': Object of class '"matrix"'; see Spatial-class

     '_p_r_o_j_4_s_t_r_i_n_g': Object of class '"CRS"'; see CRS-class

_E_x_t_e_n_d_s:

     Class '"SpatialRings"', directly. Class '"Spatial"', by class
     '"SpatialRings"'.

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

     No methods defined with class "SpatialRingsDataFrame" in the
     signature.

_N_o_t_e:

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

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

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

     SpatialRings-class

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

     data(ncshp)
     nc1 <- as.SpatialRings.Shapes(nc.shp$Shapes, as.character(nc.shp$att.data$FIPS))
     df <- nc.shp$att.data
     rownames(df) <- as.character(nc.shp$att.data$FIPS)
     identical(rownames(df), getSRSringsIDSlots(nc1))
     ncSRDF <- SpatialRingsDataFrame(nc1, df)
     names(as(ncSRDF, "data.frame"))
     rrt <- as(ncSRDF, "data.frame")$SID74/as(ncSRDF, "data.frame")$BIR74
     brks <- quantile(rrt, seq(0,1,1/7))
     cols <- grey((length(brks):2)/length(brks))
     dens <- (2:length(brks))*3
     plot.SpatialRings(ncSRDF, col=cols[findInterval(rrt, brks, all.inside=TRUE)])
     plot.SpatialRings(ncSRDF, density=dens[findInterval(rrt, brks, all.inside=TRUE)])

