matching_mt1() implements many-to-one matching between two groups of individuals with preferences specified by either a pair of data frames or a pair of data files (csv, tsv, or table).

matching_mt1(
  df_many,
  df_one,
  capacity = NULL,
  capacity_df = NULL,
  df_type = NULL,
  header = NULL,
  sep = NULL,
  algorithm = "DA",
  verbose = TRUE
)

Arguments

df_many

A data frame or a data file containing preferences of the proposers.

df_one

A data frame or a data file containing preferences of the proposed.

capacity

A value specifies how many people each of the proposed accepts as their matches. Give a value to this parameter when the capacity is constant among the proposed. Otherwise, specify capacity_df instead.

capacity_df

A data frame specifying how many people each of the proposed accepts as their matches. The first column must be the name of the proposed, which must match the first column of df_one. The second column is the capacity for each of the proposed.

df_type

Type of df_many and df_one, which should be one of "data.frame", "csv", "tsv", or "table". If not specified, matching_df() tries to determine the type.

header

A logical value showing if the data file has the header (variable names) row. If not specified, default is TRUE for "csv" and "tsv", and FALSE for "table".

sep

The field separator character. Values on each line of the file are separated by this character. If not specified, default is "," for "csv", "\t" for "tsv", and "" (white space) for "table".

algorithm

A algorithm for matching. "DA" ("Gale-Shapley", "GS") or "Boston".

verbose

If TRUE, matching steps will be printed on screen. Default to TRUE.

Value

A list of "matching" class containing (1) an extended data frame of the matching results, (2) a character string showing which algorithm was used, (3) a character string of the matching results, (4) a character string of the history of matching steps, and (5) a list of preferences of each group.

Author

Yoshio Kamijo and Yuki Yanai yanai.yuki@kochi-tech.ac.jp