mergev: Vmerge

Description Usage Arguments Details Value See Also Examples

Description

More verbose merge function

Usage

1
2
3
4
mergev(x, y, by = NULL, by.x = NULL, by.y = NULL, all.x = NULL,
  all.y = NULL, all = NULL, order = c("sort", "unsorted", "x", "y"),
  fast = FALSE, merge.type.colname = "merge.type", return.list = FALSE,
  ...)

Arguments

x

first data.frame to merge, same as in merge.

y

second data.frame to merge, same as in merge.

by

character vector of column names to merge by. When by is used, the column names must be the same in x and y. Silently overrides by.x and by.y

by.x

character vector of column names on x to merge by. The resulting file will have these names.

by.y

character vector of column names on y to merge by.

all.x

boolean indicating if unmerged rows from x should be included in the output.

all.y

boolean indicating if unmerged rows from y should be included in the output.

all

boolean indicating if unmerged rows from x and y should be included in the output. Silently overrides all.x and all.y.

order

character string from "sort", "unsorted", "x", and "y". Specifies the order of the output. Setting this to "sort" gives the same result as merge with sort=TRUE. unsorted gives the same result as sort=FALSE. "x" and "y" sort by the incoming sort order of x and y, respectively.

fast

boolean indicating if data.table should be used to do the merge.

merge.type.colname

character indicating the column name of the resulting merge type column. See description.

return.list

boolean indicating if the merged data.frame and verbose output should be returned as elements of a list. Defaults to FALSE where the function simply returns a data.frame.

...

additional parameters passed to merge.

Details

This is a wrapper for the base package merge function that prints out verbose information about the merge, including the merge type (one/many to one/many), the overlapping column names that will have suffixes applied, the number of rows and the number of unique keys that are in each dataset and the resulting dataset.

Also gives more detailed errors when, e.g. the columns named in the by argument are not on the x or y data.frames.

Value

depends on the value of return.list.

When return.list is FALSE, returns a data.frame.

When return.list is TRUE, returns a list with two elements. The first is the same data.frame result. The second is a list with the values that were printed out. Elements include merge.type with two elements, each "one" or "many" indicating the merge type for x and y, respectively; inBoth, the list of column names in both merged data.frames; and merge.matrix the matrix printed out by this function.

See Also

merge

Examples

1
#you're on your own, bucko

ahmademad/mergev documentation built on May 11, 2019, 11:31 p.m.