Learn R Programming

plotrix (version 3.8-4)

pasteCols: Paste the columns of a matrix together

Description

Paste the columns of a matrix together to form as many "words" as there are columns.

Usage

pasteCols(x,sep="")

Value

A vector of character strings.

Arguments

x

A matrix.

sep

The separator to use in the paste command.

Author

Jim Lemon

Details

pasteCols pastes the columns of a matrix together to form a vector in which each element is the concatenation of the elements in each of the columns of the matrix. It is intended for producing identifiers from a matrix returned by the combn function.

See Also

makeIntersectList

Examples

Run this code
 # create a matrix of the combinations of the first five letters of the
 # alphabet taken two at a time.
 alpha5<-combn(LETTERS[1:5],2,simplify=TRUE)
 pasteCols(alpha5,sep="+")

Run the code above in your browser using DataLab