Re: [R] sparse matrix from vector outer product

2015-01-15 Thread Philipp A.
thanks, that sounds good! Martin Maechler schrieb am Thu Jan 15 2015 at 09:07:04: > > Philipp A > > on Wed, 14 Jan 2015 14:02:40 + writes: > > > Hi, > > creating a matrix from two vectors a, b by multiplying each > combination can > > be done e.g. via > > > a %*%

Re: [R] sparse matrix from vector outer product

2015-01-15 Thread Martin Maechler
> Philipp A > on Wed, 14 Jan 2015 14:02:40 + writes: > Hi, > creating a matrix from two vectors a, b by multiplying each combination can > be done e.g. via > a %*% t(b) > or via > outer(a, b) # default for third argument is '*' really the best (most e

[R] sparse matrix from vector outer product

2015-01-14 Thread Philipp A.
Hi, creating a matrix from two vectors a, b by multiplying each combination can be done e.g. via a %*% t(b) or via outer(a, b) # default for third argument is '*' But this yields a normal matrix. Is there an efficient way to create sparse matrices (from the Matrix package) like that? Right