Description Objects from the Class Slots Methods Author(s) See Also Examples
A class to hold results from deseg
.
Objects can be created by calls to deseg
, or the constructor SegDecomp
.
a numeric vector of length three, representing the locational, compositional, and qualitative segregation, respectively.
a numeric matrix or data frame with coordinates (each row is a point).
an object of class matrix
containing the population data at each data point. The number of rows in ‘data’ should equal the number of points in ‘coords’, and the number of columns should be greater than one (i.e., at least two population groups are required).
an optional projection string of class CRS
.
signature(from = "SegDecomp", to = "SpatialPoints")
: coerce an object of class SegDecomp
to an object of class SpatialPoints
. The points have no attribute data.
signature(from = "SegDecomp", to = "SpatialPointsDataFrame")
: coerce an object of class SegDecomp
to an object of class SpatialPointsDataFrame
. The values in the slot ‘data’ will be used as the attribute data.
signature(from = "SegDecomp", to = "SpatialPixelsDataFrame")
: coerce an object of class SegDecomp
to an object of class SpatialPixelsDataFrame
. This method is to retrieve the kernel density estimates and save it as a SpatialPixelsDataFrame
object, with a proj4string.
signature(from = "SegDecomp", to = "vector")
: coerce an object of class SegDecomp
to an object of class vector
. Use this to extract the segregation index values from the specified object.
signature(x = "SegDecomp")
: same as the above.
signature(object = "SegDecomp")
: print the segregation index values.
signature(x = "SegDecomp")
: same as show
.
signature(obj = "SegDecomp")
: coerce an object of class SegDecomp
to an object of class SpatialPixelsDataFrame
or SpatialPointsDataFrame
and display it. See help(spplot)
for more details about the graphical parameter arguments.
Seong-Yun Hong
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # creates 100 regularly-spaced data points and 3 population groups
xy <- expand.grid(1:10, 1:10)
colnames(xy) <- c("x", "y")
pop <- matrix(runif(300), ncol = 3)
colnames(pop) <- LETTERS[1:3]
# randomly-generated index values
d <- runif(2, 0, 0.4)
d <- c(d, 0.9 - sum(d))
# constructs an object of class 'SegDecomp'
v <- SegDecomp(d = d, coords = as.matrix(xy), data = pop)
print(v)
# retrieves the index values
as.vector(v) # same as: as(v, "vector")
# displays the kernel estimates in the slot 'data'
spplot(v, col.regions = heat.colors(20))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.