swapOrientation: Swap orientation of an assignment table
Description
This function switches the roles of victims and missing persons in a table of
assignments, from PM-oriented (victims as column names) to AM-oriented (missing
persons as column names), and vice versa. In both version, each row
describes the same assignment vector.
Usage
swapOrientation(df, from = NULL, to = NULL)
Value
A data frame with nrow(df) rows and length(to) columns.
Arguments
df
A data frame. Each row is an assignment, with * representing
non-pairing.
from
A character vector; either victims or missing persons. By
default, the column names of df. The only time this argument is needed,
if when df has other columns in addition, as in output tables of
dviJoint().
to
The column names of the transformed data frame. If missing, the
unique elements of df are used. An error is raised if to does not
contain all elements of df (except *).