Learn R Programming

seg (version 0.2-2)

update: Update an Object of Class SegLocalEnv

Description

Update an existing object of class SegLocalEnv.

Usage

## S3 method for class 'SegLocalEnv':
update(object, coords, data, env, proj4string, \dots)

Arguments

object
an object of class LocalEnv to be updated.
coords
an optional object of class matrix containing coordinates of the data points (each row is a point).
data
an optional object of class matrix containing the population of each group 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 great
env
an optional object of class matrix containing the local environment parameters. Must be the same dimensions as data.
proj4string
an optional projection string of class CRS.
...
ignored.

Value

  • An object of class SegLocalEnv.

See Also

SegLocalEnv, getSegLocalEnv, SegLocalEnv-class

Examples

Run this code
# Create a random data set with 50 data points and 3 population groups
xy <- matrix(runif(100), ncol = 2)
pop <- matrix(runif(150), ncol = 3)
localenv <- SegLocalEnv(coords = xy, data = pop)
print(localenv)

# Update the projection information
proj <- CRS("+proj=nzmg +datum=nzgd49")
localenv2 <- update(localenv, proj4string = proj)
print(localenv2)

Run the code above in your browser using DataLab