Hi,

I'd like to simply add column-wise using Matrix objects (Csparse).
It looks like one can apply mosty any base function to these objects  
(i.e., apply, colSums), but there is a nasty conversion to traditional  
matrix objects if one does that.
Is there any workaround? I can see colSum listed in the help for Class  
'CsparseMatrix' , but I wonder whether I'm using the default colSums() or  
the one specific to CsparseMatrix...

#example
(z = Matrix(c(0,1,0,0), 10,10))
zr = rowSums(z)
class(zr) # numeric; I'd like it to be a CSparseMatrix object

Thanks a lot in advance,
-Jose

-- 
Jose Quesada, PhD.
http://www.andrew.cmu.edu/~jquesada

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to