subset_migration: Subset a Migration Matrix to Match a Smaller Raster of the...

Description Usage Arguments Value

Description

This converts a migration matrix computed for one raster into a migration matrix for another raster that must be a subset of the first. This does not do any renormalization.

Usage

1
2
3
subset_migration(M, old, new, from.old = which(!is.na(raster::values(old))),
  to.old = from.old, from.new = which(!is.na(raster::values(new))),
  to.new = from.new)

Arguments

M

The migration matrix.

old

The original Raster* the migration matrix was computed for.

new

The Raster* for the new migration matrix.

from.old

The indices of the "from" cells corresponding to rows in the original migration matrix.

to.old

The indices of the "to" cells corresponding to columns in the original migration matrix.

from.new

The indices of the "from" cells corresponding to rows in the resulting migration matrix.

to.new

The indices of the "to" cells corresponding to columns in the resulting migration matrix.

Value

A migration matrix. See migrate.


petrelharp/landsim documentation built on May 25, 2019, 2:53 a.m.