Description Objects from the Class Slots Methods Author(s) See Also Examples
A class to hold the local population composition data.
Objects can be created by calls to localenv
, or the constructor SegLocal
.
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 object of class matrix
containing the local environment parameters. Must be the same dimensions as ‘data’.
an optional projection string of class CRS
.
signature(from = "SegLocal", to = "SpatialPoints")
: coerce an object of class SegLocal
to an object of class SpatialPoints
. The points have no attribute data.
signature(from = "SegLocal", to = "SpatialPointsDataFrame")
: coerce an object of class SegLocal
to an object of class SpatialPointsDataFrame
. The values in the slot ‘env’ will be used as the attribute data.
signature(from = "SegLocal", to = "SpatialPixelsDataFrame")
: coerce an object of class SegLocal
to an object of class SpatialPixelsDataFrame
. The values in the slot ‘env’ will be used as the attribute data. May not work when the points are irregularly spaced.
signature(from = "SpatialPointsDataFrame", to = "SegLocal")
: coerce an object of class SpatialPointsDataFrame
to an object of class SegLocal
.
signature(from = "SpatialPolygonsDataFrame", to = "SegLocal")
: coerce an object of class SpatialPolygonsDataFrame
to an object of class SegLocal
.
signature(object = "SegLocal")
: show the number of points and data columns in an object of class SegLocal
.
signature(x = "SegLocal")
: same as show
.
signature(x = "SegLocal")
: draw a plot, or plots, of points in an object of class SegLocal
. Use an optional argument ‘which.col’ to specify a column of the data that determines the points' sizes. See the examples below for demonstration.
signature(x = "SegLocal")
: draw points in an object of class SegLocal
on an active graphic device.
signature(obj = "SegLocal")
: coerce an object of class SegLocal
to an object of class SpatialPixelsDataFrame
or SpatialPointsDataFrame
and display it. See help(spplot)
for more details about the graphical parameter arguments.
signature(object = "SegLocal")
: summarise the population compositions of points and local environments in an object of class SegLocal
.
signature(object = "SegLocal")
: update an existing object of class SegLocal
.
Seong-Yun Hong
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | # 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]
# constructs an object of class 'SegLocal'
v <- SegLocal(coords = as.matrix(xy), data = pop, env = pop)
summary(v)
# updates the map projection information
v <- update(v, proj4string = CRS("+proj=nzmg +datum=nzgd49"))
summary(v)
# displays the (randomly-generated) local population data
par(mfrow = c(1, 3))
plot(v, main = paste("Data", colnames(pop)), xlab = "x", ylab = "y")
par(mfrow = c(1, 1))
# coverts the object to class 'Spatial'
plot(as(v, "SpatialPoints"))
spplot(v, col.regions = heat.colors(20))
v.sp <- as(v, "SpatialPixelsDataFrame")
is(v.sp)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.