chg_rownames: Changes rownames of a matrix

Description Usage Arguments Value Examples

View source: R/chg_rownames.R

Description

Function takes a vector containing names and a matrix and exchanges the rownames of the matrix with the ones provided in the names vector. Note that the row dimension of the matrix has to be equal to the length of the names vector. The function was written to enable a rownames replacement in dplyr's pipe.

Usage

1
chg_rownames(matrix, newnames)

Arguments

matrix

any matrix of dimension n*m

newnames

a character vector of length n

Value

the given matrix with changed rownames

Examples

1
2
3
4
5
## Not run: 
matrix %>%
  chg_rownames(newnames)

## End(Not run)

ECSchmitt/PPClustA documentation built on Dec. 17, 2021, 5:36 p.m.