qcombine: Combine Columns

Description Usage Arguments Value See Also Examples

View source: R/qcombine.R

Description

Quickly combine columns (summed) and rename.

Usage

1
qcombine(mat, combined.columns, elim.old = TRUE)

Arguments

mat

A matrix or dataframe with numeric combine columns.

combined.columns

A list of named vectors of the colnames/indexes of the numeric columns to be combined (summed). If a vector is unnamed a name will be assigned.

elim.old

logical. If TRUE eliminates the columns that are combined together by the named match.list. TRUE outputs the table proportionally (see prop).

Value

Returns a dataframe with combines columns.

See Also

transform

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
## Not run: 
A <- list(
    a = c(1, 2, 3),
    b = qcv(mpg, hp),
    c = c("disp", "am")
)
B <- list(
    c(1, 2, 3),
    d = qcv(mpg, hp),
    c("disp", "am")
)

qcombine(head(mtcars), A)
qcombine(head(mtcars), B)
qcombine(head(mtcars), B, elim.old = FALSE)

## End(Not run)

qdap documentation built on May 15, 2018, 9:04 a.m.