matching_df()
implements 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_df(
df1,
df2,
df_type = NULL,
header = NULL,
sep = NULL,
algorithm = "DA",
switch = FALSE,
verbose = TRUE,
mt1 = FALSE
)
A data frame or a data file containing preferences of the proposers.
A data frame or a data file containing preferences of the proposed.
Type of df1
and df2
, which should be one of
"data.frame"
, "csv"
, "tsv"
, or "table"
.
If not specified, matching_df()
tries to determine the type.
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".
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".
A algorithm for matching. "DA"
("Gale-Shapley"
, "GS"
) or "Boston"
.
A logical value. If TRUE
, the roles of g1 and g2 are
switched. That is, g2 will be the proposer group, and g1 the proposed if
TRUE
. Default is FALSE
.
If TRUE
, matching steps will be printed on screen.
Default to TRUE
.
A logical valu. TRUE
for many-to-one matching.
Default to FALSE
A list of "matching" class containing (1) a 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.
if (FALSE) {
test7 <- matching_df(
df1 = "foo1.csv",
df2 = "foo2.csv")
}