mergeSelCol3 {wrMisc}R Documentation

mergeSelCol3

Description

successive merge of selected columns out of 3 matrix or data.frames. 'selCols' will be used to define columns to be used; optionally may be different for 'dat2' : define in 'supCols2'. Output-cols will get additions specified in newSuff (default '.x' and '.y')

Usage

mergeSelCol3(
  dat1,
  dat2,
  dat3,
  selCols,
  supCols2 = NULL,
  supCols3 = NULL,
  byC = NULL,
  useAll = FALSE,
  setRownames = TRUE,
  newSuff = c(".x", ".y", ".z"),
  silent = FALSE,
  debug = FALSE,
  callFrom = NULL
)

Arguments

dat1

matrix or data.frame for fusing

dat2

matrix or data.frame for fusing

dat3

matrix or data.frame for fusing

selCols

will be used to define columns to be used; optionally may be different for 'dat2' : define in 'supCols2'

supCols2

if additional column-names should be extracted form dat2

supCols3

if additional column-names should be extracted form dat3

byC

(character) 'by' value used in merge

useAll

(logical) use all lines (will produce NAs when given identifyer not found un 2nd group of data)

setRownames

if TRUE, will use values of col used as 'by' as rownames instead of showing as add'l col in output

newSuff

(character) prefix (argument 'suffixes' in merge)

silent

(logical) suppress messages

debug

(logical) display additional messages for debugging

callFrom

(character) allow easier tracking of messages produced

Value

This function returns a data.frame containing the merged columns

See Also

merge, mergeSelCol

Examples

mat1 <- matrix(c(1:7,letters[1:7],11:17),ncol=3,dimnames=list(LETTERS[1:7],c("x1","x2","x3")))
mat2 <- matrix(c(1:6,c("b","a","e","f","g","k"),31:36), ncol=3,
  dimnames=list(LETTERS[11:16],c("y1","x2","x3")))
mat3 <- matrix(c(1:6,c("c","a","e","b","g","k"),51:56), ncol=3,
  dimnames=list(LETTERS[11:16],c("z1","x2","x3")))
mergeSelCol3(mat1, mat2, mat3, selC=c("x2","x3"))

[Package wrMisc version 1.15.1 Index]