The R Project SVN R-packages

Rev

Rev 5028 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5028 Rev 5029
Line 391... Line 391...
391
	      T <- as(object, "TsparseMatrix")
391
	      T <- as(object, "TsparseMatrix")
392
	      ## return a data frame (int, int,	 {double|logical|...})	:
392
	      ## return a data frame (int, int,	 {double|logical|...})	:
393
	      r <- data.frame(i = T@i + 1L, j = T@j + 1L, x = T@x)
393
	      r <- data.frame(i = T@i + 1L, j = T@j + 1L, x = T@x)
394
	      attr(r, "header") <-
394
	      attr(r, "header") <-
395
		  sprintf('%d x %d sparse Matrix of class "%s", with %d entries',
395
		  sprintf('%d x %d sparse Matrix of class "%s", with %d entries',
396
			  d[1], d[2], class(object), nnzero(object))
396
			  d[1], d[2], class(object),
-
 
397
                          nnzero(object, na.counted=TRUE))
397
	      ## use ole' S3 technology for such a simple case
398
	      ## use ole' S3 technology for such a simple case
398
	      class(r) <- c("sparseSummary", class(r))
399
	      class(r) <- c("sparseSummary", class(r))
399
	      r
400
	      r
400
	  })
401
	  })
401
 
402