s-news
[Top] [All Lists]

[S] filling a sparse matrix

To: "s-news (E-mail)" <S-news@wubios.wustl.edu>, "'s-nieuws'" <s-nieuws@candiensten.nl>
Subject: [S] filling a sparse matrix
From: Siem Heisterkamp <s.h.heisterkamp@amc.uva.nl>
Date: Wed, 20 Jan 1999 17:09:50 +0100
Sender: owner-s-news@wubios.wustl.edu
dear S-Plus users,
What do I wrong? I try to fill a sparse matrix. Suppose I have a (large)
matrix n*k X   and data resid unequal zero of length m.  I also have
row.num and col.num both of length m indicating each element of which
row and collumn corresponds with a value of resid.
I thought to be clever, using the assignment  :

X[row.num, col.num]<-resid[1:m]


It does not seem to work!

Anybody a bright idea?

(doing it elementswise in a loop is not a real option)
Siem Heisterkamp


Dr. S.H. Heisterkamp
University of Amsterdam
Department of Clinical Epidemiology and Biostatistics
room J2-220
PO Box 22700 1100 DE Amsterdam
tel: +31-(0)-20-5668520
fax:+31-(0)-20-6912683
s.h.heisterkamp@amc.uva.nl

-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>