is_stable()
checks if a matching result is stable.
is_stable(
x = NULL,
pairs_list = NULL,
pairs_df = NULL,
proposer_pref = NULL,
proposed_pref = NULL,
verbose = FALSE
)
An object of the "matching" class obtained by matching
or
matching_df()
. Not used if pairs
, proposer_pref
,
and proposed_pref
are provided.
An optional list of matched pairs where each element of the list is a vector of matched paris. The first element of the vector is a proposer . and the second is the person who accepted the proposal.
An optional data frame whose first column contains the
proposers' names and the second the proposed. Use NA
for "no
matching." This will be ignored if x
is provided.
A named list of preference of the proposer. The name
of the list must exactly same as the proposer's name, and the contents of
list must be the names of the proposed. This will be ignored if x
is provided.
A named list of preference of the proposer. The name
of the list must exactly same as the name of the proposed, and the contents
of the list must be the proposers' names. This will be ignored if x
is provided.
If TRUE
, the result and blocking pairs will be printed
on screen. Default is FALSE
.
A list containing (1) a logical value showing if a matching is stable and (2) a data frame containing the information of blocking pairs, if any.