MatrixPaste: Combining columns of a matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/MatrixPaste.R

Description

Combining columns of a matrix

Usage

1
2
3
MatrixPaste(x, sep = "_", forceCharacter = FALSE, stringEmpty = " ")

MatrixPaste1(x, stringEmpty = "1")

Arguments

x

Matrix or vector

sep

String used to combine columns

forceCharacter

When FALSE single column input will keep to original class in output.

stringEmpty

String used when input is empty (can be set to NULL)

Details

Each row in input will be combined to a single string using sep.

Value

Character vector or possibly same vector as input

Author(s)

Øyvind Langsrud

Examples

1
2
3
4
5
6
7
8
## Not run: 
MatrixPaste(matrix(1:12,3,4))
MatrixPaste(1:5)
MatrixPaste(1:5, forceCharacter=TRUE)
MatrixPaste(matrix(integer(0),3,0))
MatrixPaste(NULL)

## End(Not run)

statisticsnorway/SSBtools documentation built on March 3, 2020, 1:34 a.m.