revalueMatrix: Create matrix of the same size just with new values

Description Usage Arguments Author(s) See Also Examples

View source: R/revalueMatrix.R

Description

A convenience function to create a matrix of the same size as the provided one, just with new values.

Usage

1
revalueMatrix(x, values = NA, byrow = FALSE, dimnames = NULL)

Arguments

x

An old matrix.

values

The new values for matrix

byrow

logical. If FALSE (the default) the matrix is filled by columns, otherwise the matrix is filled by rows.

dimnames

A dimnames attribute for the matrix: NULL or a list of length 2 giving the row and column names respectively. An empty list is treated as NULL, and a list of length one as row names. The list can be named, and the list names will be used as names for the dimensions.

Author(s)

Vilmantas Gegzna

See Also

Other matrix operations in spMisc: corr_vec2mat(), indMatrix(), nTri2nDiag(), sort_matrix_elements, which.in(), which.max.all(), which.max.perRow()

Examples

1
2
3
4
 x <- matrix(NA, 2, 5)

 x
 revalueMatrix(x, 1:10)

GegznaV/spMisc documentation built on April 26, 2020, 5:59 p.m.