sp (version 0.7-3)

SpatialRingsDataFrame-class: Class "SpatialRingsDataFrame"

Description

class to hold polygons with attributes

Arguments

Objects from the Class

Objects can be created by calls to the function SpatialRingsDataFrame

Extends

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

Methods

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

See Also

SpatialRings-class

Examples

Run this code
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)])

Run the code above in your browser using DataCamp Workspace