Skip to content
Prev 305006 / 398506 Next

creating a symmetric matrix

???
A previous answer pointed out ?toeplitz

entering
gives

{
    if (!is.vector(x))
        stop("'x' is not a vector")
    n <- length(x)
    A <- matrix(0, n, n)
    matrix(x[abs(col(A) - row(A)) + 1], n, n)
}

Why reinvent?

-- Bert
On Fri, Sep 7, 2012 at 8:19 AM, David L Carlson <dcarlson at tamu.edu> wrote: