SegSpatial-class: Class SegSpatial

Description Objects from the Class Slots Methods Extends Author(s) See Also Examples

Description

A class to hold results from spatseg.

Objects from the Class

Objects can be created by calls to spseg, or the constructor SegSpatial.

Slots

d

an object of class numeric containing the spatial dissimilarity index value.

r

an object of class numeric containing the spatial diversity index value.

h

an object of class numeric containing the spatial information theory index value.

p

an object of class matrix that has the spatial exposure/isolation of all population groups.

coords, data, env, proj4string

see SegLocal-class.

Methods

coerce

signature(from = "SegSpatial", to = "SpatialPoints"): coerce an object of class SegSpatial to an object of class SpatialPoints. The points have no attribute data.

coerce

signature(from = "SegSpatial", to = "SpatialPointsDataFrame"): coerce an object of class SegSpatial to an object of class SpatialPointsDataFrame. The values in the slot ‘data’ will be used as the attribute data.

coerce

signature(from = "SegSpatial", to = "SpatialPixelsDataFrame"): coerce an object of class SegSpatial to an object of class SpatialPixelsDataFrame. The values in the slot ‘data’ will be used as the attribute data. May not work when the points are irregularly spaced.

coerce

signature(from = "SegSpatial", to = "list"): retrieve the segregation index values and return it as a list object.

as.list

signature(x = "SegSpatial"): same as the above.

show

signature(object = "SegSpatial"): show the segregation index values.

print

signature(x = "SegSpatial"): same as show.

spplot

signature(obj = "SegSpatial"): coerce an object of class SegSpatial to an object of class SpatialPixelsDataFrame or SpatialPointsDataFrame and display it. See help(spplot) for more details about the graphical parameter arguments.

Extends

SegLocal-class.

Author(s)

Seong-Yun Hong

See Also

SegSpatial, spseg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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)
env <- matrix(runif(300), ncol = 3)
colnames(pop) <- LETTERS[1:3]
colnames(env) <- LETTERS[4:6]

# constructs an object of class 'SegSpatial'
v <- SegSpatial(d = numeric(), r = numeric(), h = numeric(), 
                p = matrix(0, 0, 0), 
                coords = as.matrix(xy), data = pop, env = env)
print(v)

# changes the spatial dissimilarity index value
slot(v, "d") <- runif(1)

# retrieves the index values
as.list(v)

# displays the values in the slot 'data'
spplot(v, col.regions = heat.colors(20))

# displays the values in the slot 'env'
w <- as(v, "SegLocal")
spplot(w, col.regions = heat.colors(20))

seg documentation built on Dec. 19, 2019, 1:09 a.m.