SCM

SCM Repository

[matrix] Diff of /pkg/tests/indexing.R
ViewVC logotype

Diff of /pkg/tests/indexing.R

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

revision 2363, Thu Apr 9 20:45:32 2009 UTC revision 2439, Sat Jul 18 16:03:36 2009 UTC
# Line 39  Line 39 
39                       LETTERS[1:ncol(mn)])                       LETTERS[1:ncol(mn)])
40  checkMatrix(mn)  checkMatrix(mn)
41  mn["rd", "D"]  mn["rd", "D"]
42    ## Printing sparse colnames:
43    ms <- as(mn,"sparseMatrix")
44    ms[sample(28, 20)] <- 0
45    ms <- t(rbind2(ms, 3*ms))
46    cnam1 <- capture.output(show(ms))[2] ; op <- options("sparse.colnames" = "abb3")
47    cnam2 <- capture.output(show(ms))[2] ; options(op) # revert
48  stopifnot(identical(mn["rc", "D"], mn[3,4]), mn[3,4] == 24,  stopifnot(identical(mn["rc", "D"], mn[3,4]), mn[3,4] == 24,
49            identical(mn[, "A"], mn[,1]), mn[,1] == 1:7,            identical(mn[, "A"], mn[,1]), mn[,1] == 1:7,
50            identical(mn[c("re", "rb"), "B"], mn[c(5,2), 2])            identical(mn[c("re", "rb"), "B"], mn[c(5,2), 2]),
51            )            ## sparse printing
52              grep("^ +$", cnam1) == 1, # cnam1 is empty
53              identical(cnam2,
54                        paste(" ", paste(rep(rownames(mn), 2), collapse=" "))))
55    
56  mo <- m  mo <- m
57  m[2,3] <- 100  m[2,3] <- 100

Legend:
Removed from v.2363  
changed lines
  Added in v.2439

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