Description Usage Arguments Details Value See Also Examples
View source: R/zero_matrix_diag.R
Create a structural zero matrix with TRUE
on the diagonal and FALSE
everywhere else.
This matrix represents situtation where a movement
between any pair of distinct states is permitted,
but a movement from a state to itself is prohibited.
1 | zero_matrix_diag(state, basename = "state")
|
state |
A character vector, giving the names of the states. |
basename |
Prefix used to construct dimension
names. Defaults to |
Diagonal structural zero matrices are often used when modelling migration, since migration statistics often show movements between regions, but not movements within regions.
A square matrix with TRUE
on the
diagonal, FALSE
elsewhere, and
dimnames constructed from states
.
zero_matrix_trans
deals with the
general case.
1 2 3 | states <- c("Thailand", "Malaysia", "Singapore")
zero_matrix_diag(states)
zero_matrix_diag(states, basename = "country")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.