seq2mat | R Documentation |
Fills a matrix of ncol = length(x)
and nrow = length(x)
with
the values in dat
and setting the diagonal to 1.
seq2mat(x, dat)
x |
names of columns and rows, used to define the size of the matrix |
dat |
Data to fill with the matrix with except the diagonal. |
dat
should be at least choose(length(x), 2)
of length. It
assumes that the data provided comes from using the row and column id to
obtain it.
A square matrix with the diagonal set to 1 and dat
on the
upper and lower triangle with the columns ids and row ids from x.
LluĂs Revilla
upper.tri()
and lower.tri()
seq2mat(LETTERS[1:5], 1:10)
seq2mat(LETTERS[1:5], seq(from = 0.1, to = 1, by = 0.1))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.