mig_matrix: Helper function to format migration input

View source: R/mig_matrix.R

mig_matrixR Documentation

Helper function to format migration input

Description

Helper function to format migration input

Usage

mig_matrix(
  m,
  array = TRUE,
  orig_col = "orig",
  dest_col = "dest",
  flow_col = "flow"
)

Arguments

m

A matrix or data frame of origin-destination flows. For matrix the first and second dimensions correspond to origin and destination respectively. For a data frame ensure the correct column names are passed to orig_col, dest_col and flow_col.

array

Logical on return of array of all dimensions or origin-destination matrix (summed over all other dimensions)

orig_col

Character string of the origin column name (when m is a data frame rather than a matrix)

dest_col

Character string of the destination column name (when m is a data frame rather than a matrix)

flow_col

Character string of the flow column name (when m is a data frame rather than a matrix)

Value

Formatted matrix


migest documentation built on Nov. 18, 2023, 9:06 a.m.