SCM

SCM Repository

[matrix] Diff of /pkg/R/dgTMatrix.R
ViewVC logotype

Diff of /pkg/R/dgTMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1289, Tue Jun 6 14:48:37 2006 UTC revision 1290, Thu Jun 8 09:30:21 2006 UTC
# Line 242  Line 242 
242  setMethod("writeMM", signature(obj = "dgTMatrix"),  setMethod("writeMM", signature(obj = "dgTMatrix"),
243            function(obj, file, ...)            function(obj, file, ...)
244            .Call(Matrix_writeMatrixMarket, obj, as.character(file), "DGT"))            .Call(Matrix_writeMatrixMarket, obj, as.character(file), "DGT"))
245    
246    
247    setMethod("colSums", signature(x = "dgTMatrix"),
248              function(x, na.rm = FALSE, dims = 1)
249              tapply1(x@x, factor(x@j, 0:(x@Dim[2]-1)), sum, na.rm = na.rm),
250              valueClass = "numeric")
251    setMethod("colMeans", signature(x = "dgTMatrix"),
252              function(x, na.rm = FALSE, dims = 1)
253              tapply1(x@x, factor(x@j, 0:(x@Dim[2]-1)), mean, na.rm = na.rm),
254              valueClass = "numeric")
255    
256    setMethod("rowSums", signature(x = "dgTMatrix"),
257              function(x, na.rm = FALSE, dims = 1)
258              tapply1(x@x, factor(x@i, 0:(x@Dim[1]-1)), sum, na.rm = na.rm),
259              valueClass = "numeric")
260    setMethod("rowMeans", signature(x = "dgTMatrix"),
261              function(x, na.rm = FALSE, dims = 1)
262              tapply1(x@x, factor(x@i, 0:(x@Dim[1]-1)), mean, na.rm = na.rm),
263              valueClass = "numeric")

Legend:
Removed from v.1289  
changed lines
  Added in v.1290

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge