Re: [R] Table to matrix

2010-05-24 Thread William Dunlap
> From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Kathryn Lord > Sent: Monday, May 24, 2010 11:16 AM > To: r-help@r-project.org > Subject: [R] Table to matrix > > Dear R users, > > I am trying to make this

Re: [R] Table to matrix

2010-05-24 Thread Dennis Murphy
Hi: Here's one way, but not especially elegant. The idea is to initialize a matrix of zeros, produce an index matrix from two of your objects and then assign the third object to the specified indices. x <- matrix(0, nrow = 3, ncol = 10) row <- rep(1:nrow(x), unname(sapply(y.covar, nrow))) row [1]

[R] Table to matrix

2010-05-24 Thread Kathryn Lord
Dear R users, I am trying to make this (3 by 10) matrix A --A 0 0 00 1 0 0 0 0 0 0 0 00 0 1 0 0 0 0 0 0.5 0.5 0 0 0 0 0 0 0 --- from "mass.func" --