| matching | R Documentation | 
matching() implements matching between two groups of
individuals.
matching(
  g1_prefs,
  g2_prefs,
  g1_names = NULL,
  g2_names = NULL,
  algorithm = "DA",
  switch = FALSE,
  verbose = TRUE,
  mt1 = FALSE
)
g1_prefs | 
 A list of preferences of individuals who make proposals.  | 
g2_prefs | 
 A named list of preferences of individuals who receives proposals.  | 
g1_names | 
 A vector of names of the proposers. You can pass a named list
to   | 
g2_names | 
 A vector of names of the proposers. You can pass a named list
to   | 
algorithm | 
 A algorithm for matching.   | 
switch | 
 A logical value. If   | 
verbose | 
 If   | 
mt1 | 
 A logical valu.   | 
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.
Yoshio Kamijo and Yuki Yanai yanai.yuki@kochi-tech.ac.jp
test1 <- matching(
  g1_prefs = list(w1 = c(1, 2),
                  w2 = c(2, 1),
                  w3 = c(1, 2)),
  g2_prefs = list(m1 = c(1, 2, 3),
                  m2 = c(2, 3, 1)))
test2 <- matching(
  g1_names = c("w1", "w2", "w3"),
  g1_prefs = list(c(1, 2),
                  c(2, 1),
                  c(1, 2)),
  g2_names = c("m1", "m2"),
  g2_prefs = list(c(1, 2, 3),
                  c(2, 3, 1)))
test3 <- matching(
  g1_names = c("Amy", "Beatrice", "Cindy"),
  g1_prefs = list(c("Dick", "Eric"),
                  c("Eric", "Dick"),
                  c("Dick", "Eric")),
  g2_names = c("Dick", "Eric"),
  g2_prefs = list(c("Amy", "Beatrice", "Cindy"),
                  c("Beatrice", "Cindy", "Amy")))
test4 <- matching(
  g1_prefs <- list(w1 = c(1, 2),
                   w2 = c(2, 1),
                   w3 = c(1, 2)),
  g2_prefs <- list(m1 = c(1, 2),
                   m2 = c(2, 3)))
## Not run: 
  ## The following function throws an error because a name (Jack) does not
  ## exist in the opponent's pool.
  test5 <- matching(
    g1_names = c("Amy", "Beatrice", "Cindy"),
    g1_prefs = list(c("Dick", "Eric"),
                    c("Eric", "Dick"),
                    c("Dick", "Jack")),
    g2_names = c("Dick", "Eric"),
    g2_prefs = list(c("Amy", "Beatrice", "Cindy"),
                    c("Beatrice", "Cindy", "Amy")))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.