dat2mat: Convert a dataframe in a long format to a wide matrix

Description Usage Arguments Details Examples

View source: R/dat2mat.R

Description

This function converts 3-column dataframe such as produced with mat2dat back into a matrix with the IDs in the first two columns used as dimnames

Usage

1
dat2mat(data = data, forceSymmetric = FALSE, diag = FALSE)

Arguments

data

a matrix

forceSymmetric

boolean, if matrix has a empty triangle, fill over the diagonal

diag

boolean, should a diagonal be added if absent?

Details

If value column is type numeric or integer the function will return a numeric matrix, otherwise a character matrix will be returned.

Examples

1

vjf2/SocGen documentation built on April 24, 2021, 10:59 a.m.