metaMerge: Recursively Merge Multiple Tables

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

Perform an n-way merge, given multiple objects or file names.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
	## S3 method for class 'list'
metaMerge(x,all=TRUE,...)
	## S3 method for class 'character'
metaMerge(x,import=read.table,all=TRUE,...)
	## Default S3 method:
metaMerge(x,y,all=TRUE,...)
	## S3 method for class 'data.frame'
metaMerge(x,y,all=TRUE,...)
	## S3 method for class 'NULL'
metaMerge(x,y,all=TRUE,...)

Arguments

x

a list of objects, e.g. data.frames, or a character vector of file names

y

a second object

all

passed to merge

import

a function for reading files

...

passed to import

Details

If x is a character vector, it is presumed to be file names. An error is returned if any file does not exist. Otherwise, files are acquired using import (after a call to match.fun). The resulting list of objects is merged.

If x is an empty list, it is returned. If of length one, the first element is returned. Otherwise, the first element is merged with the second, and the result merged with the third (if present), and so on. Merges are full or outer merges; i.e. all=TRUE.

The default method simply calls merge and is present for methodological reasons.

Value

object like the elements of x, or given by import

Note

In most cases, merge is eventually called. Since merge is generic, what happens next depends on the class of the arguments. For example, a merge method has been defined for class nm, which may give unexpected results.

Author(s)

Tim Bergsma

References

http://metrumrg.googlecode.com

See Also

Examples

1
2
#a nonsense example
head(metaMerge(list(Theoph,BOD)))

metrumrg documentation built on May 2, 2019, 5:55 p.m.