Learn R Programming

hierfstat (version 0.5-11)

vec2mat: Fills a triangular matrix from the inputed vector

Description

Fills a triangular matrix from the inputed vector

Usage

vec2mat(x,diag=FALSE,upper=FALSE)

Arguments

x

a vector

diag

whether the vector contains the diagonal elements

upper

whether the vector contains the upper trinagular matrix elements

Value

a matrix

Examples

Run this code
# NOT RUN {
{
 vec2mat(1:10)
 vec2mat(1:10,diag=TRUE)
 vec2mat(1:10,upper=TRUE)
}
# }

Run the code above in your browser using DataLab