vec2mat: vec2mat

View source: R/vec2mat.R

vec2matR Documentation

vec2mat

Description

Converts a vector horizontal or vertical matrix and sets row- or colnames. If rownames or colnames are given then existing row names or column names are overwritten.

Usage

vec2mat(x, colnames = NULL, rownames = NULL, horizontal = TRUE)

Arguments

x

vector:

colnames

character: vector of new column names (default: NULL)

rownames

character: vector of new row names (default: NULL)

horizontal

logical: horizontal or vertical matrix (default: TRUE)

Value

matrix

Examples

x <- runif(5)
vec2mat(x)
vec2mat(x, horizontal=FALSE)

sigbertklinke/exams2moodle documentation built on July 6, 2023, 3:26 p.m.