Learn R Programming

seg (version 0.4-1)

SegSpatial-class: Class SegSpatial

Description

A class to hold results from spatseg.

Arguments

Objects from the Class

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

See Also

SegSpatial, spseg

Examples

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

Run the code above in your browser using DataLab