Back to Multiple platform build/check report for BioC 3.21: simplified long |
|
This page was generated on 2025-10-02 11:38 -0400 (Thu, 02 Oct 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 (2025-06-13) -- "Great Square Root" | 4831 |
merida1 | macOS 12.7.5 Monterey | x86_64 | 4.5.1 RC (2025-06-05 r88288) -- "Great Square Root" | 4612 |
kjohnson1 | macOS 13.6.6 Ventura | arm64 | 4.5.1 Patched (2025-06-14 r88325) -- "Great Square Root" | 4553 |
kunpeng2 | Linux (openEuler 24.03 LTS) | aarch64 | R Under development (unstable) (2025-02-19 r87757) -- "Unsuffered Consequences" | 4584 |
Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X |
Package 252/2341 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.72.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | ![]() | ||||||||
merida1 | macOS 12.7.5 Monterey / x86_64 | OK | OK | WARNINGS | OK | ![]() | ||||||||
kjohnson1 | macOS 13.6.6 Ventura / arm64 | OK | OK | WARNINGS | OK | ![]() | ||||||||
kunpeng2 | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. |
Package: BufferedMatrix |
Version: 1.72.0 |
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz |
StartedAt: 2025-09-30 00:55:08 -0400 (Tue, 30 Sep 2025) |
EndedAt: 2025-09-30 00:56:22 -0400 (Tue, 30 Sep 2025) |
EllapsedTime: 74.4 seconds |
RetCode: 0 |
Status: WARNINGS |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 1 |
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.72.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.5.1 RC (2025-06-05 r88288) * using platform: x86_64-apple-darwin20 * R was compiled by Apple clang version 14.0.0 (clang-1400.0.29.202) GNU Fortran (GCC) 14.2.0 * running under: macOS Monterey 12.7.6 * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.72.0’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘BufferedMatrix’ can be installed ... WARNING Found the following significant warnings: doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] See ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details. * used C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’ * used SDK: ‘MacOSX11.3.sdk’ * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... NOTE checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup? 209 | $x^{power}$ elementwise of the matrix | ^ prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking compiled code ... NOTE Note: information on .o files is not available * checking sizes of PDF files under ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... NONE * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘Rcodetesting.R’ Running ‘c_code_level_tests.R’ Running ‘objectTesting.R’ Running ‘rawCalltesting.R’ OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking running R code from vignettes ... SKIPPED * checking re-building of vignette outputs ... SKIPPED * checking PDF version of manual ... OK * DONE Status: 1 WARNING, 2 NOTEs See ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library ‘/Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library’ * installing *source* package ‘BufferedMatrix’ ... ** this is package ‘BufferedMatrix’ version ‘1.72.0’ ** using staged installation ** libs using C compiler: ‘Apple clang version 14.0.0 (clang-1400.0.29.202)’ using SDK: ‘MacOSX11.3.sdk’ clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] if (!(Matrix->readonly) & setting){ ^ ~ doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first if (!(Matrix->readonly) & setting){ ^ ( ) doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning if (!(Matrix->readonly) & setting){ ^ ( ) doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function] static int sort_double(const double *a1,const double *a2){ ^ 2 warnings generated. clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o clang -arch x86_64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/x86_64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o clang -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/x86_64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R installing to /Library/Frameworks/R.framework/Versions/4.5-x86_64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs ** R ** inst ** byte-compile and prepare package for lazy loading Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’ Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’ Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’ ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.5.1 RC (2025-06-05 r88288) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BufferedMatrix);library.dynam("BufferedMatrix", "BufferedMatrix", .libPaths());.C("dbm_c_tester",integer(1)) Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 Adding Additional Column Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 Reassigning values 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Resizing Buffers Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 3 Buffer Cols: 3 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Activating Row Buffer In row mode: 1 1.000000 6.000000 11.000000 16.000000 21.000000 26.000000 2.000000 7.000000 12.000000 17.000000 22.000000 27.000000 3.000000 8.000000 13.000000 18.000000 23.000000 28.000000 4.000000 9.000000 14.000000 19.000000 24.000000 29.000000 5.000000 10.000000 15.000000 20.000000 25.000000 30.000000 Squaring Last Column 1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 5.000000 10.000000 15.000000 20.000000 25.000000 900.000000 Square rooting Last Row, then turing off Row Buffer In row mode: 0 Checking on value that should be not be in column buffer2.236068 1.000000 6.000000 11.000000 16.000000 21.000000 676.000000 2.000000 7.000000 12.000000 17.000000 22.000000 729.000000 3.000000 8.000000 13.000000 18.000000 23.000000 784.000000 4.000000 9.000000 14.000000 19.000000 24.000000 841.000000 2.236068 3.162278 3.872983 4.472136 5.000000 30.000000 Single Indexing. Assign each value its square 1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 Resizing Buffers Smaller Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 1.000000 36.000000 121.000000 256.000000 441.000000 676.000000 4.000000 49.000000 144.000000 289.000000 484.000000 729.000000 9.000000 64.000000 169.000000 324.000000 529.000000 784.000000 16.000000 81.000000 196.000000 361.000000 576.000000 841.000000 25.000000 100.000000 225.000000 400.000000 625.000000 900.000000 Activating Row Mode. Resizing Buffers Checking dimensions Rows: 5 Cols: 6 Buffer Rows: 1 Buffer Cols: 1 Activating ReadOnly Mode. The results of assignment is: 0 Printing matrix reversed. 900.000000 625.000000 400.000000 225.000000 100.000000 25.000000 841.000000 576.000000 361.000000 196.000000 81.000000 16.000000 784.000000 529.000000 324.000000 169.000000 64.000000 9.000000 729.000000 484.000000 289.000000 144.000000 49.000000 -30.000000 676.000000 441.000000 256.000000 121.000000 -20.000000 -10.000000 [[1]] [1] 0 > > proc.time() user system elapsed 0.595 0.207 0.795
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.1 RC (2025-06-05 r88288) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > > ### this is used to control how many repetitions in something below > ### higher values result in more checks. > nreps <-100 ##20000 > > > ## test creation and some simple assignments and subsetting operations > > ## first on single elements > tmp <- createBufferedMatrix(1000,10) > > tmp[10,5] [1] 0 > tmp[10,5] <- 10 > tmp[10,5] [1] 10 > tmp[10,5] <- 12.445 > tmp[10,5] [1] 12.445 > > > > ## now testing accessing multiple elements > tmp2 <- createBufferedMatrix(10,20) > > > tmp2[3,1] <- 51.34 > tmp2[9,2] <- 9.87654 > tmp2[,1:2] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[,-(3:20)] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 > tmp2[-3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 0 > tmp2[2,1:3] [,1] [,2] [,3] [1,] 0 0 0 > tmp2[3:9,1:3] [,1] [,2] [,3] [1,] 51.34 0.00000 0 [2,] 0.00 0.00000 0 [3,] 0.00 0.00000 0 [4,] 0.00 0.00000 0 [5,] 0.00 0.00000 0 [6,] 0.00 0.00000 0 [7,] 0.00 9.87654 0 > tmp2[-4,-4] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [1,] 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 > > ## now testing accessing/assigning multiple elements > tmp3 <- createBufferedMatrix(10,10) > > for (i in 1:10){ + for (j in 1:10){ + tmp3[i,j] <- (j-1)*10 + i + } + } > > tmp3[2:4,2:4] [,1] [,2] [,3] [1,] 12 22 32 [2,] 13 23 33 [3,] 14 24 34 > tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 11 21 31 11 21 31 91 1 11 1 11 21 31 [2,] 12 22 32 12 22 32 92 2 12 2 12 22 32 [3,] 13 23 33 13 23 33 93 3 13 3 13 23 33 [4,] 14 24 34 14 24 34 94 4 14 4 14 24 34 [5,] 15 25 35 15 25 35 95 5 15 5 15 25 35 [6,] 16 26 36 16 26 36 96 6 16 6 16 26 36 [7,] 17 27 37 17 27 37 97 7 17 7 17 27 37 [8,] 18 28 38 18 28 38 98 8 18 8 18 28 38 [9,] 19 29 39 19 29 39 99 9 19 9 19 29 39 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 41 51 61 71 81 91 91 81 71 61 51 41 [2,] 42 52 62 72 82 92 92 82 72 62 52 42 [3,] 43 53 63 73 83 93 93 83 73 63 53 43 [4,] 44 54 64 74 84 94 94 84 74 64 54 44 [5,] 45 55 65 75 85 95 95 85 75 65 55 45 [6,] 46 56 66 76 86 96 96 86 76 66 56 46 [7,] 47 57 67 77 87 97 97 87 77 67 57 47 [8,] 48 58 68 78 88 98 98 88 78 68 58 48 [9,] 49 59 69 79 89 99 99 89 79 69 59 49 [,26] [,27] [,28] [,29] [1,] 31 21 11 1 [2,] 32 22 12 2 [3,] 33 23 13 3 [4,] 34 24 14 4 [5,] 35 25 15 5 [6,] 36 26 16 6 [7,] 37 27 17 7 [8,] 38 28 18 8 [9,] 39 29 19 9 > tmp3[-c(1:5),-c(6:10)] [,1] [,2] [,3] [,4] [,5] [1,] 6 16 26 36 46 [2,] 7 17 27 37 47 [3,] 8 18 28 38 48 [4,] 9 19 29 39 49 [5,] 10 20 30 40 50 > > ## assignment of whole columns > tmp3[,1] <- c(1:10*100.0) > tmp3[,1:2] <- tmp3[,1:2]*100 > tmp3[,1:2] <- tmp3[,2:1] > tmp3[,1:2] [,1] [,2] [1,] 1100 1e+04 [2,] 1200 2e+04 [3,] 1300 3e+04 [4,] 1400 4e+04 [5,] 1500 5e+04 [6,] 1600 6e+04 [7,] 1700 7e+04 [8,] 1800 8e+04 [9,] 1900 9e+04 [10,] 2000 1e+05 > > > tmp3[,-1] <- tmp3[,1:9] > tmp3[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1100 1100 1e+04 21 31 41 51 61 71 81 [2,] 1200 1200 2e+04 22 32 42 52 62 72 82 [3,] 1300 1300 3e+04 23 33 43 53 63 73 83 [4,] 1400 1400 4e+04 24 34 44 54 64 74 84 [5,] 1500 1500 5e+04 25 35 45 55 65 75 85 [6,] 1600 1600 6e+04 26 36 46 56 66 76 86 [7,] 1700 1700 7e+04 27 37 47 57 67 77 87 [8,] 1800 1800 8e+04 28 38 48 58 68 78 88 [9,] 1900 1900 9e+04 29 39 49 59 69 79 89 [10,] 2000 2000 1e+05 30 40 50 60 70 80 90 > > tmp3[,1:2] <- rep(1,10) > tmp3[,1:2] <- rep(1,20) > tmp3[,1:2] <- matrix(c(1:5),1,5) > > tmp3[,-c(1:8)] <- matrix(c(1:5),1,5) > > tmp3[1,] <- 1:10 > tmp3[1,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 > tmp3[-1,] <- c(1,2) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 2 1 2 1 2 1 2 1 2 1 [10,] 1 2 1 2 1 2 1 2 1 2 > tmp3[-c(1:8),] <- matrix(c(1:5),1,5) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 1 3 5 2 4 1 3 5 2 4 [10,] 2 4 1 3 5 2 4 1 3 5 > > > tmp3[1:2,1:2] <- 5555.04 > tmp3[-(1:2),1:2] <- 1234.56789 > > > > ## testing accessors for the directory and prefix > directory(tmp3) [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests" > prefix(tmp3) [1] "BM" > > ## testing if we can remove these objects > rm(tmp, tmp2, tmp3) > gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 480849 25.7 1056621 56.5 NA 634465 33.9 Vcells 891080 6.8 8388608 64.0 65536 2108740 16.1 > > > > > ## > ## checking reads > ## > > tmp2 <- createBufferedMatrix(10,20) > > test.sample <- rnorm(10*20) > > tmp2[1:10,1:20] <- test.sample > > test.matrix <- matrix(test.sample,10,20) > > ## testing reads > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Tue Sep 30 00:55:41 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Tue Sep 30 00:55:42 2025" > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > > > RowMode(tmp2) <pointer: 0x600003b68000> > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Tue Sep 30 00:55:48 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Tue Sep 30 00:55:51 2025" > > ColMode(tmp2) <pointer: 0x600003b68000> > > > > ### Now testing assignments > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + + new.data <- rnorm(20) + tmp2[which.row,] <- new.data + test.matrix[which.row,] <- new.data + if (rep > 1){ + if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + + } > > > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + new.data <- rnorm(10) + tmp2[,which.col] <- new.data + test.matrix[,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.col <- which.col + } > > > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,5,replace=TRUE) + new.data <- matrix(rnorm(50),5,10) + tmp2[,which.col] <- new.data + test.matrix[,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.col <- which.col + } > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + new.data <- matrix(rnorm(50),5,10) + tmp2[which.row,] <- new.data + test.matrix[which.row,]<- new.data + + if (rep > 1){ + if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + } > > > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:20,5,replace=TRUE) + new.data <- matrix(rnorm(25),5,5) + tmp2[which.row,which.col] <- new.data + test.matrix[which.row,which.col]<- new.data + + if (rep > 1){ + if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){ + cat("incorrect agreement") + break; + } + } + prev.row <- which.row + prev.col <- which.col + } > > > > > ### > ### > ### testing some more functions > ### > > > > ## duplication function > tmp5 <- duplicate(tmp2) > > # making sure really did copy everything. > tmp5[1,1] <- tmp5[1,1] +100.00 > > if (tmp5[1,1] == tmp2[1,1]){ + stop("Problem with duplication") + } > > > > > ### testing elementwise applying of functions > > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 99.81089693 -1.3949717 0.2859473 2.17572981 [2,] -0.42084230 2.5512135 0.6347347 -0.08661389 [3,] 0.84115388 0.8242945 -0.0773835 2.31156693 [4,] 0.08267039 1.3088051 0.4124475 0.10971443 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 99.81089693 1.3949717 0.2859473 2.17572981 [2,] 0.42084230 2.5512135 0.6347347 0.08661389 [3,] 0.84115388 0.8242945 0.0773835 2.31156693 [4,] 0.08267039 1.3088051 0.4124475 0.10971443 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 9.9905404 1.1810892 0.5347404 1.4750355 [2,] 0.6487236 1.5972518 0.7967024 0.2943024 [3,] 0.9171444 0.9079067 0.2781789 1.5203838 [4,] 0.2875246 1.1440302 0.6422207 0.3312317 > > my.function <- function(x,power){ + (x+5)^power + } > > ewApply(tmp5,my.function,power=2) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 224.71630 38.20586 30.63335 41.92609 [2,] 31.90808 43.52373 33.60176 28.02964 [3,] 35.01260 34.90336 27.85917 42.51541 [4,] 27.95792 37.74911 31.83465 28.42203 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x600003b680c0> > exp(tmp5) <pointer: 0x600003b680c0> > log(tmp5,2) <pointer: 0x600003b680c0> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 467.7175 > Min(tmp5) [1] 53.98118 > mean(tmp5) [1] 73.39902 > Sum(tmp5) [1] 14679.8 > Var(tmp5) [1] 860.1976 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 91.53772 68.33245 71.44974 72.29779 70.61500 72.53172 71.94130 73.42353 [9] 70.93739 70.92354 > rowSums(tmp5) [1] 1830.754 1366.649 1428.995 1445.956 1412.300 1450.634 1438.826 1468.471 [9] 1418.748 1418.471 > rowVars(tmp5) [1] 7915.00184 94.84246 60.58396 66.39659 92.81799 58.32765 [7] 74.26890 86.40247 86.47072 71.68169 > rowSd(tmp5) [1] 88.966296 9.738709 7.783570 8.148410 9.634209 7.637254 8.617940 [8] 9.295293 9.298964 8.466504 > rowMax(tmp5) [1] 467.71754 90.58895 88.49025 87.05750 87.47217 84.21507 88.59290 [8] 97.75163 84.69498 88.29791 > rowMin(tmp5) [1] 58.35423 54.99613 57.98522 58.19074 54.95476 56.70116 55.53973 58.19150 [9] 53.98118 56.73218 > > colMeans(tmp5) [1] 110.12449 76.78407 68.80197 73.65509 74.40855 74.47033 72.41083 [8] 66.93593 70.90737 71.21310 69.99842 75.59799 71.82135 69.28412 [15] 70.58927 71.33187 69.52974 75.29396 68.47123 66.35067 > colSums(tmp5) [1] 1101.2449 767.8407 688.0197 736.5509 744.0855 744.7033 724.1083 [8] 669.3593 709.0737 712.1310 699.9842 755.9799 718.2135 692.8412 [15] 705.8927 713.3187 695.2974 752.9396 684.7123 663.5067 > colVars(tmp5) [1] 15835.78190 80.75152 55.90216 126.05410 36.01432 42.24497 [7] 79.28132 50.09470 77.78504 75.74724 42.03543 72.07906 [13] 110.54923 75.02428 54.18246 117.83323 73.80654 97.05694 [19] 56.06352 108.48906 > colSd(tmp5) [1] 125.840303 8.986185 7.476775 11.227382 6.001193 6.499613 [7] 8.904006 7.077761 8.819583 8.703289 6.483474 8.489939 [13] 10.514240 8.661656 7.360873 10.855101 8.591073 9.851748 [19] 7.487558 10.415808 > colMax(tmp5) [1] 467.71754 90.58895 82.74891 88.49025 80.72671 85.93480 88.59290 [8] 79.68492 86.40819 83.48319 81.32449 87.81471 86.48972 82.85577 [15] 81.03483 88.29791 85.41839 97.75163 77.57250 84.16277 > colMin(tmp5) [1] 58.19074 63.03391 57.98522 58.34002 62.83169 64.47699 61.01688 59.04608 [9] 61.56370 55.53973 59.64890 64.30099 55.87474 56.19537 58.95239 54.95476 [17] 56.70116 62.59829 54.99613 53.98118 > > > ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default) > > > which.row <- sample(1:10,1,replace=TRUE) > which.col <- sample(1:20,1,replace=TRUE) > > tmp5[which.row,which.col] <- NA > > Max(tmp5) [1] NA > Min(tmp5) [1] NA > mean(tmp5) [1] NA > Sum(tmp5) [1] NA > Var(tmp5) [1] NA > > rowMeans(tmp5) [1] 91.53772 68.33245 71.44974 72.29779 70.61500 72.53172 71.94130 NA [9] 70.93739 70.92354 > rowSums(tmp5) [1] 1830.754 1366.649 1428.995 1445.956 1412.300 1450.634 1438.826 NA [9] 1418.748 1418.471 > rowVars(tmp5) [1] 7915.00184 94.84246 60.58396 66.39659 92.81799 58.32765 [7] 74.26890 56.59113 86.47072 71.68169 > rowSd(tmp5) [1] 88.966296 9.738709 7.783570 8.148410 9.634209 7.637254 8.617940 [8] 7.522708 9.298964 8.466504 > rowMax(tmp5) [1] 467.71754 90.58895 88.49025 87.05750 87.47217 84.21507 88.59290 [8] NA 84.69498 88.29791 > rowMin(tmp5) [1] 58.35423 54.99613 57.98522 58.19074 54.95476 56.70116 55.53973 NA [9] 53.98118 56.73218 > > colMeans(tmp5) [1] 110.12449 76.78407 68.80197 73.65509 74.40855 74.47033 72.41083 [8] 66.93593 70.90737 71.21310 69.99842 75.59799 71.82135 69.28412 [15] 70.58927 71.33187 69.52974 NA 68.47123 66.35067 > colSums(tmp5) [1] 1101.2449 767.8407 688.0197 736.5509 744.0855 744.7033 724.1083 [8] 669.3593 709.0737 712.1310 699.9842 755.9799 718.2135 692.8412 [15] 705.8927 713.3187 695.2974 NA 684.7123 663.5067 > colVars(tmp5) [1] 15835.78190 80.75152 55.90216 126.05410 36.01432 42.24497 [7] 79.28132 50.09470 77.78504 75.74724 42.03543 72.07906 [13] 110.54923 75.02428 54.18246 117.83323 73.80654 NA [19] 56.06352 108.48906 > colSd(tmp5) [1] 125.840303 8.986185 7.476775 11.227382 6.001193 6.499613 [7] 8.904006 7.077761 8.819583 8.703289 6.483474 8.489939 [13] 10.514240 8.661656 7.360873 10.855101 8.591073 NA [19] 7.487558 10.415808 > colMax(tmp5) [1] 467.71754 90.58895 82.74891 88.49025 80.72671 85.93480 88.59290 [8] 79.68492 86.40819 83.48319 81.32449 87.81471 86.48972 82.85577 [15] 81.03483 88.29791 85.41839 NA 77.57250 84.16277 > colMin(tmp5) [1] 58.19074 63.03391 57.98522 58.34002 62.83169 64.47699 61.01688 59.04608 [9] 61.56370 55.53973 59.64890 64.30099 55.87474 56.19537 58.95239 54.95476 [17] 56.70116 NA 54.99613 53.98118 > > Max(tmp5,na.rm=TRUE) [1] 467.7175 > Min(tmp5,na.rm=TRUE) [1] 53.98118 > mean(tmp5,na.rm=TRUE) [1] 73.27664 > Sum(tmp5,na.rm=TRUE) [1] 14582.05 > Var(tmp5,na.rm=TRUE) [1] 861.5317 > > rowMeans(tmp5,na.rm=TRUE) [1] 91.53772 68.33245 71.44974 72.29779 70.61500 72.53172 71.94130 72.14311 [9] 70.93739 70.92354 > rowSums(tmp5,na.rm=TRUE) [1] 1830.754 1366.649 1428.995 1445.956 1412.300 1450.634 1438.826 1370.719 [9] 1418.748 1418.471 > rowVars(tmp5,na.rm=TRUE) [1] 7915.00184 94.84246 60.58396 66.39659 92.81799 58.32765 [7] 74.26890 56.59113 86.47072 71.68169 > rowSd(tmp5,na.rm=TRUE) [1] 88.966296 9.738709 7.783570 8.148410 9.634209 7.637254 8.617940 [8] 7.522708 9.298964 8.466504 > rowMax(tmp5,na.rm=TRUE) [1] 467.71754 90.58895 88.49025 87.05750 87.47217 84.21507 88.59290 [8] 87.17458 84.69498 88.29791 > rowMin(tmp5,na.rm=TRUE) [1] 58.35423 54.99613 57.98522 58.19074 54.95476 56.70116 55.53973 58.19150 [9] 53.98118 56.73218 > > colMeans(tmp5,na.rm=TRUE) [1] 110.12449 76.78407 68.80197 73.65509 74.40855 74.47033 72.41083 [8] 66.93593 70.90737 71.21310 69.99842 75.59799 71.82135 69.28412 [15] 70.58927 71.33187 69.52974 72.79866 68.47123 66.35067 > colSums(tmp5,na.rm=TRUE) [1] 1101.2449 767.8407 688.0197 736.5509 744.0855 744.7033 724.1083 [8] 669.3593 709.0737 712.1310 699.9842 755.9799 718.2135 692.8412 [15] 705.8927 713.3187 695.2974 655.1880 684.7123 663.5067 > colVars(tmp5,na.rm=TRUE) [1] 15835.78190 80.75152 55.90216 126.05410 36.01432 42.24497 [7] 79.28132 50.09470 77.78504 75.74724 42.03543 72.07906 [13] 110.54923 75.02428 54.18246 117.83323 73.80654 39.14089 [19] 56.06352 108.48906 > colSd(tmp5,na.rm=TRUE) [1] 125.840303 8.986185 7.476775 11.227382 6.001193 6.499613 [7] 8.904006 7.077761 8.819583 8.703289 6.483474 8.489939 [13] 10.514240 8.661656 7.360873 10.855101 8.591073 6.256268 [19] 7.487558 10.415808 > colMax(tmp5,na.rm=TRUE) [1] 467.71754 90.58895 82.74891 88.49025 80.72671 85.93480 88.59290 [8] 79.68492 86.40819 83.48319 81.32449 87.81471 86.48972 82.85577 [15] 81.03483 88.29791 85.41839 80.75223 77.57250 84.16277 > colMin(tmp5,na.rm=TRUE) [1] 58.19074 63.03391 57.98522 58.34002 62.83169 64.47699 61.01688 59.04608 [9] 61.56370 55.53973 59.64890 64.30099 55.87474 56.19537 58.95239 54.95476 [17] 56.70116 62.59829 54.99613 53.98118 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 91.53772 68.33245 71.44974 72.29779 70.61500 72.53172 71.94130 NaN [9] 70.93739 70.92354 > rowSums(tmp5,na.rm=TRUE) [1] 1830.754 1366.649 1428.995 1445.956 1412.300 1450.634 1438.826 0.000 [9] 1418.748 1418.471 > rowVars(tmp5,na.rm=TRUE) [1] 7915.00184 94.84246 60.58396 66.39659 92.81799 58.32765 [7] 74.26890 NA 86.47072 71.68169 > rowSd(tmp5,na.rm=TRUE) [1] 88.966296 9.738709 7.783570 8.148410 9.634209 7.637254 8.617940 [8] NA 9.298964 8.466504 > rowMax(tmp5,na.rm=TRUE) [1] 467.71754 90.58895 88.49025 87.05750 87.47217 84.21507 88.59290 [8] NA 84.69498 88.29791 > rowMin(tmp5,na.rm=TRUE) [1] 58.35423 54.99613 57.98522 58.19074 54.95476 56.70116 55.53973 NA [9] 53.98118 56.73218 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 115.01515 77.73857 67.25232 73.21751 73.81874 74.72474 72.55488 [8] 66.87655 71.57219 70.62294 69.97728 74.31170 71.28704 70.02924 [15] 69.57399 71.99463 68.78521 NaN 68.51731 67.25724 > colSums(tmp5,na.rm=TRUE) [1] 1035.1363 699.6471 605.2708 658.9576 664.3686 672.5227 652.9939 [8] 601.8890 644.1497 635.6064 629.7955 668.8053 641.5833 630.2632 [15] 626.1660 647.9516 619.0669 0.0000 616.6558 605.3152 > colVars(tmp5,na.rm=TRUE) [1] 17546.17136 80.59596 35.87367 139.65673 36.60244 46.79743 [7] 88.95805 56.31688 82.53588 81.29742 47.28483 62.47542 [13] 121.15605 78.15635 49.35890 127.62090 76.79628 NA [19] 63.04757 112.80406 > colSd(tmp5,na.rm=TRUE) [1] 132.461962 8.977525 5.989463 11.817645 6.049995 6.840865 [7] 9.431757 7.504457 9.084926 9.016508 6.876397 7.904140 [13] 11.007091 8.840608 7.025589 11.296942 8.763349 NA [19] 7.940250 10.620926 > colMax(tmp5,na.rm=TRUE) [1] 467.71754 90.58895 76.14162 88.49025 80.72671 85.93480 88.59290 [8] 79.68492 86.40819 83.48319 81.32449 87.81471 86.48972 82.85577 [15] 81.03483 88.29791 85.41839 -Inf 77.57250 84.16277 > colMin(tmp5,na.rm=TRUE) [1] 58.19074 63.03391 57.98522 58.34002 62.83169 64.47699 61.01688 59.04608 [9] 61.56370 55.53973 59.64890 64.30099 55.87474 56.19537 58.95239 54.95476 [17] 56.70116 Inf 54.99613 53.98118 > > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 3 > which.col <- 1 > cat(which.row," ",which.col,"\n") 3 1 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > rowVars(tmp5,na.rm=TRUE) [1] 193.57820 183.85960 258.24312 95.09861 123.92177 281.59281 185.42321 [8] 136.93978 228.77559 110.47608 > apply(copymatrix,1,var,na.rm=TRUE) [1] 193.57820 183.85960 258.24312 95.09861 123.92177 281.59281 185.42321 [8] 136.93978 228.77559 110.47608 > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 1 > which.col <- 3 > cat(which.row," ",which.col,"\n") 1 3 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE) [1] -8.526513e-14 -4.263256e-14 0.000000e+00 -1.136868e-13 -1.421085e-14 [6] 1.421085e-13 -5.684342e-14 5.684342e-14 5.684342e-14 5.684342e-14 [11] 1.136868e-13 1.421085e-14 -1.421085e-13 2.842171e-14 -9.947598e-14 [16] 2.842171e-14 1.989520e-13 0.000000e+00 0.000000e+00 8.526513e-14 > > > > > > > > > > > ## making sure these things agree > ## > ## first when there is no NA > > > > agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){ + + if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){ + stop("No agreement in Max") + } + + + if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){ + stop("No agreement in Min") + } + + + if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){ + + cat(Sum(buff.matrix,na.rm=TRUE),"\n") + cat(sum(r.matrix,na.rm=TRUE),"\n") + cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n") + + stop("No agreement in Sum") + } + + if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){ + stop("No agreement in mean") + } + + + if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){ + stop("No agreement in Var") + } + + + + if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowMeans") + } + + + if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in colMeans") + } + + + if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in rowSums") + } + + + if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){ + stop("No agreement in colSums") + } + + ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when + ### computing variance + my.Var <- function(x,na.rm=FALSE){ + if (all(is.na(x))){ + return(NA) + } else { + var(x,na.rm=na.rm) + } + + } + + if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowVars") + } + + + if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in rowVars") + } + + + if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMax") + } + + + if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMax") + } + + + + if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMin") + } + + + if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMin") + } + + if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colMedian") + } + + if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){ + stop("No agreement in colRanges") + } + + + + } > > > > > > > > > > for (rep in 1:20){ + copymatrix <- matrix(rnorm(200,150,15),10,20) + + tmp5[1:10,1:20] <- copymatrix + + + agree.checks(tmp5,copymatrix) + + ## now lets assign some NA values and check agreement + + which.row <- sample(1:10,1,replace=TRUE) + which.col <- sample(1:20,1,replace=TRUE) + + cat(which.row," ",which.col,"\n") + + tmp5[which.row,which.col] <- NA + copymatrix[which.row,which.col] <- NA + + agree.checks(tmp5,copymatrix) + + ## make an entire row NA + tmp5[which.row,] <- NA + copymatrix[which.row,] <- NA + + + agree.checks(tmp5,copymatrix) + + ### also make an entire col NA + tmp5[,which.col] <- NA + copymatrix[,which.col] <- NA + + agree.checks(tmp5,copymatrix) + + ### now make 1 element non NA with NA in the rest of row and column + + tmp5[which.row,which.col] <- rnorm(1,150,15) + copymatrix[which.row,which.col] <- tmp5[which.row,which.col] + + agree.checks(tmp5,copymatrix) + } 3 13 9 6 7 19 10 6 1 14 5 3 10 14 7 2 3 17 8 1 3 20 10 2 10 10 2 9 4 2 7 10 2 13 7 20 5 18 6 12 There were 50 or more warnings (use warnings() to see the first 50) > > > ### now test 1 by n and n by 1 matrix > > > err.tol <- 1e-12 > > rm(tmp5) > > dataset1 <- rnorm(100) > dataset2 <- rnorm(100) > > tmp <- createBufferedMatrix(1,100) > tmp[1,] <- dataset1 > > tmp2 <- createBufferedMatrix(100,1) > tmp2[,1] <- dataset2 > > > > > > Max(tmp) [1] 3.269659 > Min(tmp) [1] -2.401338 > mean(tmp) [1] 0.06135006 > Sum(tmp) [1] 6.135006 > Var(tmp) [1] 1.027378 > > rowMeans(tmp) [1] 0.06135006 > rowSums(tmp) [1] 6.135006 > rowVars(tmp) [1] 1.027378 > rowSd(tmp) [1] 1.013597 > rowMax(tmp) [1] 3.269659 > rowMin(tmp) [1] -2.401338 > > colMeans(tmp) [1] -0.316321453 -0.727183330 -0.094095072 -1.687715026 -2.401338209 [6] -0.131942817 -0.820827277 -0.520246491 0.960861690 -0.597269253 [11] 0.702044546 -0.603356421 0.313304729 -1.450912621 -0.304474093 [16] -1.674521414 -0.212050451 1.802353229 0.978201267 -0.511976415 [21] 0.086203464 1.707986785 -1.099622258 0.570994464 0.551844450 [26] -2.046862586 0.233215014 -0.101994257 -0.006537922 0.138533625 [31] 0.478168993 0.318310919 -0.707272314 0.459241244 1.066030638 [36] 0.866090745 0.501261012 1.002391858 0.300973001 -0.406202875 [41] 1.600580854 1.312367248 0.118994923 0.417140504 1.034146244 [46] 2.166510892 1.007501398 0.279410326 0.164774660 0.790847470 [51] -0.450505606 -0.377539915 0.728813616 0.148012093 -1.656257324 [56] 0.732743762 -1.785155691 2.195499747 -0.155970376 -0.031217623 [61] 1.281391108 -0.026287367 -1.651365917 -0.244208533 0.623561174 [66] 0.530755587 -1.192339852 -0.579035912 0.666449185 -0.201995108 [71] 0.659617588 3.269658740 1.463610417 -1.346760461 -0.861318801 [76] 0.361944645 0.302184170 -1.293590969 0.508051069 0.217339118 [81] 1.275299979 -1.173223949 0.323120543 -0.592654709 -0.709874460 [86] 0.144176922 1.061751305 -1.494161911 -1.120524969 1.505839449 [91] -1.042210111 -0.316011003 0.059739260 1.194303289 -0.798665904 [96] 0.377635858 -0.594479682 -0.240830258 1.460732852 -0.528602520 > colSums(tmp) [1] -0.316321453 -0.727183330 -0.094095072 -1.687715026 -2.401338209 [6] -0.131942817 -0.820827277 -0.520246491 0.960861690 -0.597269253 [11] 0.702044546 -0.603356421 0.313304729 -1.450912621 -0.304474093 [16] -1.674521414 -0.212050451 1.802353229 0.978201267 -0.511976415 [21] 0.086203464 1.707986785 -1.099622258 0.570994464 0.551844450 [26] -2.046862586 0.233215014 -0.101994257 -0.006537922 0.138533625 [31] 0.478168993 0.318310919 -0.707272314 0.459241244 1.066030638 [36] 0.866090745 0.501261012 1.002391858 0.300973001 -0.406202875 [41] 1.600580854 1.312367248 0.118994923 0.417140504 1.034146244 [46] 2.166510892 1.007501398 0.279410326 0.164774660 0.790847470 [51] -0.450505606 -0.377539915 0.728813616 0.148012093 -1.656257324 [56] 0.732743762 -1.785155691 2.195499747 -0.155970376 -0.031217623 [61] 1.281391108 -0.026287367 -1.651365917 -0.244208533 0.623561174 [66] 0.530755587 -1.192339852 -0.579035912 0.666449185 -0.201995108 [71] 0.659617588 3.269658740 1.463610417 -1.346760461 -0.861318801 [76] 0.361944645 0.302184170 -1.293590969 0.508051069 0.217339118 [81] 1.275299979 -1.173223949 0.323120543 -0.592654709 -0.709874460 [86] 0.144176922 1.061751305 -1.494161911 -1.120524969 1.505839449 [91] -1.042210111 -0.316011003 0.059739260 1.194303289 -0.798665904 [96] 0.377635858 -0.594479682 -0.240830258 1.460732852 -0.528602520 > colVars(tmp) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > colSd(tmp) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > colMax(tmp) [1] -0.316321453 -0.727183330 -0.094095072 -1.687715026 -2.401338209 [6] -0.131942817 -0.820827277 -0.520246491 0.960861690 -0.597269253 [11] 0.702044546 -0.603356421 0.313304729 -1.450912621 -0.304474093 [16] -1.674521414 -0.212050451 1.802353229 0.978201267 -0.511976415 [21] 0.086203464 1.707986785 -1.099622258 0.570994464 0.551844450 [26] -2.046862586 0.233215014 -0.101994257 -0.006537922 0.138533625 [31] 0.478168993 0.318310919 -0.707272314 0.459241244 1.066030638 [36] 0.866090745 0.501261012 1.002391858 0.300973001 -0.406202875 [41] 1.600580854 1.312367248 0.118994923 0.417140504 1.034146244 [46] 2.166510892 1.007501398 0.279410326 0.164774660 0.790847470 [51] -0.450505606 -0.377539915 0.728813616 0.148012093 -1.656257324 [56] 0.732743762 -1.785155691 2.195499747 -0.155970376 -0.031217623 [61] 1.281391108 -0.026287367 -1.651365917 -0.244208533 0.623561174 [66] 0.530755587 -1.192339852 -0.579035912 0.666449185 -0.201995108 [71] 0.659617588 3.269658740 1.463610417 -1.346760461 -0.861318801 [76] 0.361944645 0.302184170 -1.293590969 0.508051069 0.217339118 [81] 1.275299979 -1.173223949 0.323120543 -0.592654709 -0.709874460 [86] 0.144176922 1.061751305 -1.494161911 -1.120524969 1.505839449 [91] -1.042210111 -0.316011003 0.059739260 1.194303289 -0.798665904 [96] 0.377635858 -0.594479682 -0.240830258 1.460732852 -0.528602520 > colMin(tmp) [1] -0.316321453 -0.727183330 -0.094095072 -1.687715026 -2.401338209 [6] -0.131942817 -0.820827277 -0.520246491 0.960861690 -0.597269253 [11] 0.702044546 -0.603356421 0.313304729 -1.450912621 -0.304474093 [16] -1.674521414 -0.212050451 1.802353229 0.978201267 -0.511976415 [21] 0.086203464 1.707986785 -1.099622258 0.570994464 0.551844450 [26] -2.046862586 0.233215014 -0.101994257 -0.006537922 0.138533625 [31] 0.478168993 0.318310919 -0.707272314 0.459241244 1.066030638 [36] 0.866090745 0.501261012 1.002391858 0.300973001 -0.406202875 [41] 1.600580854 1.312367248 0.118994923 0.417140504 1.034146244 [46] 2.166510892 1.007501398 0.279410326 0.164774660 0.790847470 [51] -0.450505606 -0.377539915 0.728813616 0.148012093 -1.656257324 [56] 0.732743762 -1.785155691 2.195499747 -0.155970376 -0.031217623 [61] 1.281391108 -0.026287367 -1.651365917 -0.244208533 0.623561174 [66] 0.530755587 -1.192339852 -0.579035912 0.666449185 -0.201995108 [71] 0.659617588 3.269658740 1.463610417 -1.346760461 -0.861318801 [76] 0.361944645 0.302184170 -1.293590969 0.508051069 0.217339118 [81] 1.275299979 -1.173223949 0.323120543 -0.592654709 -0.709874460 [86] 0.144176922 1.061751305 -1.494161911 -1.120524969 1.505839449 [91] -1.042210111 -0.316011003 0.059739260 1.194303289 -0.798665904 [96] 0.377635858 -0.594479682 -0.240830258 1.460732852 -0.528602520 > colMedians(tmp) [1] -0.316321453 -0.727183330 -0.094095072 -1.687715026 -2.401338209 [6] -0.131942817 -0.820827277 -0.520246491 0.960861690 -0.597269253 [11] 0.702044546 -0.603356421 0.313304729 -1.450912621 -0.304474093 [16] -1.674521414 -0.212050451 1.802353229 0.978201267 -0.511976415 [21] 0.086203464 1.707986785 -1.099622258 0.570994464 0.551844450 [26] -2.046862586 0.233215014 -0.101994257 -0.006537922 0.138533625 [31] 0.478168993 0.318310919 -0.707272314 0.459241244 1.066030638 [36] 0.866090745 0.501261012 1.002391858 0.300973001 -0.406202875 [41] 1.600580854 1.312367248 0.118994923 0.417140504 1.034146244 [46] 2.166510892 1.007501398 0.279410326 0.164774660 0.790847470 [51] -0.450505606 -0.377539915 0.728813616 0.148012093 -1.656257324 [56] 0.732743762 -1.785155691 2.195499747 -0.155970376 -0.031217623 [61] 1.281391108 -0.026287367 -1.651365917 -0.244208533 0.623561174 [66] 0.530755587 -1.192339852 -0.579035912 0.666449185 -0.201995108 [71] 0.659617588 3.269658740 1.463610417 -1.346760461 -0.861318801 [76] 0.361944645 0.302184170 -1.293590969 0.508051069 0.217339118 [81] 1.275299979 -1.173223949 0.323120543 -0.592654709 -0.709874460 [86] 0.144176922 1.061751305 -1.494161911 -1.120524969 1.505839449 [91] -1.042210111 -0.316011003 0.059739260 1.194303289 -0.798665904 [96] 0.377635858 -0.594479682 -0.240830258 1.460732852 -0.528602520 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.3163215 -0.7271833 -0.09409507 -1.687715 -2.401338 -0.1319428 [2,] -0.3163215 -0.7271833 -0.09409507 -1.687715 -2.401338 -0.1319428 [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] -0.8208273 -0.5202465 0.9608617 -0.5972693 0.7020445 -0.6033564 0.3133047 [2,] -0.8208273 -0.5202465 0.9608617 -0.5972693 0.7020445 -0.6033564 0.3133047 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] -1.450913 -0.3044741 -1.674521 -0.2120505 1.802353 0.9782013 -0.5119764 [2,] -1.450913 -0.3044741 -1.674521 -0.2120505 1.802353 0.9782013 -0.5119764 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [1,] 0.08620346 1.707987 -1.099622 0.5709945 0.5518445 -2.046863 0.233215 [2,] 0.08620346 1.707987 -1.099622 0.5709945 0.5518445 -2.046863 0.233215 [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] -0.1019943 -0.006537922 0.1385336 0.478169 0.3183109 -0.7072723 0.4592412 [2,] -0.1019943 -0.006537922 0.1385336 0.478169 0.3183109 -0.7072723 0.4592412 [,35] [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 1.066031 0.8660907 0.501261 1.002392 0.300973 -0.4062029 1.600581 1.312367 [2,] 1.066031 0.8660907 0.501261 1.002392 0.300973 -0.4062029 1.600581 1.312367 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 0.1189949 0.4171405 1.034146 2.166511 1.007501 0.2794103 0.1647747 [2,] 0.1189949 0.4171405 1.034146 2.166511 1.007501 0.2794103 0.1647747 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] 0.7908475 -0.4505056 -0.3775399 0.7288136 0.1480121 -1.656257 0.7327438 [2,] 0.7908475 -0.4505056 -0.3775399 0.7288136 0.1480121 -1.656257 0.7327438 [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] -1.785156 2.1955 -0.1559704 -0.03121762 1.281391 -0.02628737 -1.651366 [2,] -1.785156 2.1955 -0.1559704 -0.03121762 1.281391 -0.02628737 -1.651366 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [1,] -0.2442085 0.6235612 0.5307556 -1.19234 -0.5790359 0.6664492 -0.2019951 [2,] -0.2442085 0.6235612 0.5307556 -1.19234 -0.5790359 0.6664492 -0.2019951 [,71] [,72] [,73] [,74] [,75] [,76] [,77] [1,] 0.6596176 3.269659 1.46361 -1.34676 -0.8613188 0.3619446 0.3021842 [2,] 0.6596176 3.269659 1.46361 -1.34676 -0.8613188 0.3619446 0.3021842 [,78] [,79] [,80] [,81] [,82] [,83] [,84] [1,] -1.293591 0.5080511 0.2173391 1.2753 -1.173224 0.3231205 -0.5926547 [2,] -1.293591 0.5080511 0.2173391 1.2753 -1.173224 0.3231205 -0.5926547 [,85] [,86] [,87] [,88] [,89] [,90] [,91] [1,] -0.7098745 0.1441769 1.061751 -1.494162 -1.120525 1.505839 -1.04221 [2,] -0.7098745 0.1441769 1.061751 -1.494162 -1.120525 1.505839 -1.04221 [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] -0.316011 0.05973926 1.194303 -0.7986659 0.3776359 -0.5944797 -0.2408303 [2,] -0.316011 0.05973926 1.194303 -0.7986659 0.3776359 -0.5944797 -0.2408303 [,99] [,100] [1,] 1.460733 -0.5286025 [2,] 1.460733 -0.5286025 > > > Max(tmp2) [1] 2.179616 > Min(tmp2) [1] -3.161911 > mean(tmp2) [1] -0.2317481 > Sum(tmp2) [1] -23.17481 > Var(tmp2) [1] 0.9094666 > > rowMeans(tmp2) [1] -0.6191944274 -1.0123450656 -0.8576053831 1.4912100898 1.1531641403 [6] 0.5172760609 -0.9185546505 -0.5489323535 -3.1619107897 -0.5026328884 [11] 0.2421214728 -1.2593194831 -1.4637317303 0.3410345207 0.5190598992 [16] -0.4407982605 -0.4279753856 -1.1536272814 0.7110952109 -1.8947022181 [21] -0.6406566471 0.2504271738 -0.8655431456 -0.9328193778 -1.6926911622 [26] 0.3414824173 -0.1187308751 0.7254922581 -0.6755485128 -0.6946199488 [31] 0.0614191565 -0.8698448062 -0.5400766543 -1.3238238551 -0.3820476105 [36] -0.1813061305 -1.3226933449 0.4676752889 0.5749938545 -0.7391149050 [41] 0.9574128916 -0.7101345737 1.1798449014 -0.8123461520 1.5386647154 [46] -0.9989276637 0.4166802782 0.9698689814 1.3100662554 0.4535395048 [51] -0.4308677827 1.0643915270 -1.3793132791 0.7672456798 -1.3369564051 [56] 0.2030047818 -0.0004358452 -0.6471930373 -0.9466070336 0.1964704020 [61] 0.0458145274 1.2504191540 -0.3248493243 -0.0345151415 -1.6361775118 [66] -0.3465568695 1.1103436816 1.0824517050 -1.5072901386 2.1796163196 [71] 0.1083171644 -0.4692796607 -2.0074655899 -0.4091063348 -0.9542261136 [76] 0.9300768522 -0.6543635989 0.7869616705 -0.1405667594 0.2330095753 [81] 1.0586805630 -1.0894916217 -0.2714383797 -1.2037533550 -0.6706227018 [86] -0.7495556088 -0.3523799101 -0.1631961821 1.4424742981 1.2597112860 [91] 0.0113222002 -1.5665157868 -0.3440633259 -1.1916996601 0.6584065427 [96] 0.1826943751 -1.5477269944 -0.0787625657 -0.3542877518 -1.3972274101 > rowSums(tmp2) [1] -0.6191944274 -1.0123450656 -0.8576053831 1.4912100898 1.1531641403 [6] 0.5172760609 -0.9185546505 -0.5489323535 -3.1619107897 -0.5026328884 [11] 0.2421214728 -1.2593194831 -1.4637317303 0.3410345207 0.5190598992 [16] -0.4407982605 -0.4279753856 -1.1536272814 0.7110952109 -1.8947022181 [21] -0.6406566471 0.2504271738 -0.8655431456 -0.9328193778 -1.6926911622 [26] 0.3414824173 -0.1187308751 0.7254922581 -0.6755485128 -0.6946199488 [31] 0.0614191565 -0.8698448062 -0.5400766543 -1.3238238551 -0.3820476105 [36] -0.1813061305 -1.3226933449 0.4676752889 0.5749938545 -0.7391149050 [41] 0.9574128916 -0.7101345737 1.1798449014 -0.8123461520 1.5386647154 [46] -0.9989276637 0.4166802782 0.9698689814 1.3100662554 0.4535395048 [51] -0.4308677827 1.0643915270 -1.3793132791 0.7672456798 -1.3369564051 [56] 0.2030047818 -0.0004358452 -0.6471930373 -0.9466070336 0.1964704020 [61] 0.0458145274 1.2504191540 -0.3248493243 -0.0345151415 -1.6361775118 [66] -0.3465568695 1.1103436816 1.0824517050 -1.5072901386 2.1796163196 [71] 0.1083171644 -0.4692796607 -2.0074655899 -0.4091063348 -0.9542261136 [76] 0.9300768522 -0.6543635989 0.7869616705 -0.1405667594 0.2330095753 [81] 1.0586805630 -1.0894916217 -0.2714383797 -1.2037533550 -0.6706227018 [86] -0.7495556088 -0.3523799101 -0.1631961821 1.4424742981 1.2597112860 [91] 0.0113222002 -1.5665157868 -0.3440633259 -1.1916996601 0.6584065427 [96] 0.1826943751 -1.5477269944 -0.0787625657 -0.3542877518 -1.3972274101 > rowVars(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowSd(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowMax(tmp2) [1] -0.6191944274 -1.0123450656 -0.8576053831 1.4912100898 1.1531641403 [6] 0.5172760609 -0.9185546505 -0.5489323535 -3.1619107897 -0.5026328884 [11] 0.2421214728 -1.2593194831 -1.4637317303 0.3410345207 0.5190598992 [16] -0.4407982605 -0.4279753856 -1.1536272814 0.7110952109 -1.8947022181 [21] -0.6406566471 0.2504271738 -0.8655431456 -0.9328193778 -1.6926911622 [26] 0.3414824173 -0.1187308751 0.7254922581 -0.6755485128 -0.6946199488 [31] 0.0614191565 -0.8698448062 -0.5400766543 -1.3238238551 -0.3820476105 [36] -0.1813061305 -1.3226933449 0.4676752889 0.5749938545 -0.7391149050 [41] 0.9574128916 -0.7101345737 1.1798449014 -0.8123461520 1.5386647154 [46] -0.9989276637 0.4166802782 0.9698689814 1.3100662554 0.4535395048 [51] -0.4308677827 1.0643915270 -1.3793132791 0.7672456798 -1.3369564051 [56] 0.2030047818 -0.0004358452 -0.6471930373 -0.9466070336 0.1964704020 [61] 0.0458145274 1.2504191540 -0.3248493243 -0.0345151415 -1.6361775118 [66] -0.3465568695 1.1103436816 1.0824517050 -1.5072901386 2.1796163196 [71] 0.1083171644 -0.4692796607 -2.0074655899 -0.4091063348 -0.9542261136 [76] 0.9300768522 -0.6543635989 0.7869616705 -0.1405667594 0.2330095753 [81] 1.0586805630 -1.0894916217 -0.2714383797 -1.2037533550 -0.6706227018 [86] -0.7495556088 -0.3523799101 -0.1631961821 1.4424742981 1.2597112860 [91] 0.0113222002 -1.5665157868 -0.3440633259 -1.1916996601 0.6584065427 [96] 0.1826943751 -1.5477269944 -0.0787625657 -0.3542877518 -1.3972274101 > rowMin(tmp2) [1] -0.6191944274 -1.0123450656 -0.8576053831 1.4912100898 1.1531641403 [6] 0.5172760609 -0.9185546505 -0.5489323535 -3.1619107897 -0.5026328884 [11] 0.2421214728 -1.2593194831 -1.4637317303 0.3410345207 0.5190598992 [16] -0.4407982605 -0.4279753856 -1.1536272814 0.7110952109 -1.8947022181 [21] -0.6406566471 0.2504271738 -0.8655431456 -0.9328193778 -1.6926911622 [26] 0.3414824173 -0.1187308751 0.7254922581 -0.6755485128 -0.6946199488 [31] 0.0614191565 -0.8698448062 -0.5400766543 -1.3238238551 -0.3820476105 [36] -0.1813061305 -1.3226933449 0.4676752889 0.5749938545 -0.7391149050 [41] 0.9574128916 -0.7101345737 1.1798449014 -0.8123461520 1.5386647154 [46] -0.9989276637 0.4166802782 0.9698689814 1.3100662554 0.4535395048 [51] -0.4308677827 1.0643915270 -1.3793132791 0.7672456798 -1.3369564051 [56] 0.2030047818 -0.0004358452 -0.6471930373 -0.9466070336 0.1964704020 [61] 0.0458145274 1.2504191540 -0.3248493243 -0.0345151415 -1.6361775118 [66] -0.3465568695 1.1103436816 1.0824517050 -1.5072901386 2.1796163196 [71] 0.1083171644 -0.4692796607 -2.0074655899 -0.4091063348 -0.9542261136 [76] 0.9300768522 -0.6543635989 0.7869616705 -0.1405667594 0.2330095753 [81] 1.0586805630 -1.0894916217 -0.2714383797 -1.2037533550 -0.6706227018 [86] -0.7495556088 -0.3523799101 -0.1631961821 1.4424742981 1.2597112860 [91] 0.0113222002 -1.5665157868 -0.3440633259 -1.1916996601 0.6584065427 [96] 0.1826943751 -1.5477269944 -0.0787625657 -0.3542877518 -1.3972274101 > > colMeans(tmp2) [1] -0.2317481 > colSums(tmp2) [1] -23.17481 > colVars(tmp2) [1] 0.9094666 > colSd(tmp2) [1] 0.9536596 > colMax(tmp2) [1] 2.179616 > colMin(tmp2) [1] -3.161911 > colMedians(tmp2) [1] -0.3494684 > colRanges(tmp2) [,1] [1,] -3.161911 [2,] 2.179616 > > dataset1 <- matrix(dataset1,1,100) > > agree.checks(tmp,dataset1) > > dataset2 <- matrix(dataset2,100,1) > agree.checks(tmp2,dataset2) > > > tmp <- createBufferedMatrix(10,10) > > tmp[1:10,1:10] <- rnorm(100) > colApply(tmp,sum) [1] 3.32039092 -6.57558439 -0.46380415 4.32646068 0.15874195 4.49850180 [7] -0.68480042 -7.11382808 0.20434832 0.01926541 > colApply(tmp,quantile)[,1] [,1] [1,] -1.134011266 [2,] -0.265766070 [3,] 0.008522628 [4,] 0.806064879 [5,] 2.123778116 > > rowApply(tmp,sum) [1] 1.4505178 -2.6366345 -3.3732860 -3.1156455 -1.9920326 -0.2089304 [7] 1.9087358 1.5495185 3.0360277 1.0714213 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 10 4 8 6 2 6 4 9 10 5 [2,] 6 3 7 2 4 9 1 2 9 1 [3,] 3 6 5 7 5 3 5 10 1 4 [4,] 9 7 9 1 3 10 9 8 7 8 [5,] 1 10 10 9 7 2 6 4 2 3 [6,] 8 9 6 8 9 7 7 7 3 7 [7,] 4 5 4 4 1 8 10 1 6 6 [8,] 5 1 2 3 6 1 2 6 5 9 [9,] 7 8 1 10 10 5 3 3 4 2 [10,] 2 2 3 5 8 4 8 5 8 10 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] -0.70559489 -2.05152656 0.79323548 -2.83345668 -2.56676934 0.10641165 [7] 1.88340910 0.25859223 -2.35660118 1.49413619 -0.02744170 -1.16867346 [13] -1.57322371 1.49375459 -2.46504261 0.03919491 -4.46062729 -0.80413541 [19] 0.36737491 -2.62515845 > colApply(tmp,quantile)[,1] [,1] [1,] -0.8236679 [2,] -0.7636239 [3,] -0.4811829 [4,] 0.2107266 [5,] 1.1521533 > > rowApply(tmp,sum) [1] -5.6929354 -11.3060036 -0.7992479 -0.4853182 1.0813629 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 19 8 8 13 6 [2,] 18 1 10 1 18 [3,] 17 7 17 12 10 [4,] 2 5 20 5 5 [5,] 7 14 14 3 7 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.1521533 0.5506058 0.4233222 -1.5557194 -0.96083937 0.1444720 [2,] -0.8236679 -1.7007294 -1.1144114 -1.2703377 -0.01370071 0.2357862 [3,] -0.4811829 -0.1626274 1.1297966 1.5853539 0.17281893 -0.5466739 [4,] 0.2107266 -2.0174628 0.1907614 -0.7845491 -1.01563256 0.7635479 [5,] -0.7636239 1.2786873 0.1637667 -0.8082044 -0.74941563 -0.4907206 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.3322731 0.06310838 -0.23726223 -0.20688820 -1.183013 -0.5396620 [2,] -0.1445716 -1.30270366 0.08422307 0.83949192 -1.146088 -0.5244561 [3,] 0.7151317 -0.03152755 0.12103054 -0.02712683 -1.046490 -0.4763717 [4,] -0.1115168 1.26358599 -0.27133810 -0.92748671 1.597124 1.0542523 [5,] 1.0920927 0.26612906 -2.05325447 1.81614601 1.751025 -0.6824359 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -1.2415086 2.05393323 -1.0349323 -0.82379040 -1.1681012 0.2640084 [2,] -0.7116785 0.13570239 -0.6057888 0.03695856 -1.5027292 0.2403910 [3,] 1.1717050 -0.83783753 -1.4473047 1.33245581 -1.3285327 -0.6689939 [4,] 0.1292993 -0.05057614 -0.3227926 -1.50388848 -0.6444995 0.6308933 [5,] -0.9210410 0.19253264 0.9457757 0.99745942 0.1832353 -1.2704342 [,19] [,20] [1,] 0.3958423 -2.1209375 [2,] -0.6390889 -1.3786054 [3,] -0.6213938 0.6485228 [4,] 0.2113198 1.1129141 [5,] 1.0206956 -0.8870524 > > > is.BufferedMatrix(tmp) [1] TRUE > > as.BufferedMatrix(as.matrix(tmp)) BufferedMatrix object Matrix size: 5 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 800 bytes. > > > > subBufferedMatrix(tmp,1:5,1:5) BufferedMatrix object Matrix size: 5 5 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 649 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 562 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -0.6696519 0.7666829 -0.6545509 -0.330683 -0.2332436 -1.097457 1.992859 col8 col9 col10 col11 col12 col13 col14 row1 -0.2859101 0.609971 -1.313115 0.4365386 -1.451675 0.3174439 1.460126 col15 col16 col17 col18 col19 col20 row1 0.02525058 -0.4562665 1.354612 1.848907 1.604454 1.03492 > tmp[,"col10"] col10 row1 -1.31311537 row2 -0.02753129 row3 0.35595858 row4 -0.53662575 row5 0.17687254 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 row1 -0.6696519 0.7666829 -0.6545509 -0.3306830 -0.2332436 -1.097457 1.9928591 row5 -0.7009417 0.2339859 -1.0688293 -0.1954346 -0.3852012 1.219008 -0.1631004 col8 col9 col10 col11 col12 col13 col14 row1 -0.2859101 0.609971 -1.3131154 0.4365386 -1.4516754 0.3174439 1.46012556 row5 1.4693364 0.149355 0.1768725 -0.4024343 0.8124326 0.4518129 -0.05774094 col15 col16 col17 col18 col19 col20 row1 0.02525058 -0.4562665 1.3546117 1.848907 1.604454 1.034920 row5 0.16021891 0.5915766 0.7317313 1.657954 1.852431 -0.723472 > tmp[,c("col6","col20")] col6 col20 row1 -1.0974566 1.03491953 row2 0.6952996 -1.02618455 row3 0.3364693 0.65278323 row4 1.4299033 -0.01414666 row5 1.2190085 -0.72347199 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 -1.097457 1.034920 row5 1.219008 -0.723472 > > > > > tmp["row1",] <- rnorm(20,mean=10) > tmp[,"col10"] <- rnorm(5,mean=30) > tmp[c("row1","row5"),] <- rnorm(40,mean=50) > tmp[,c("col6","col20")] <- rnorm(10,mean=75) > tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105) > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.36092 51.22001 52.21265 50.63899 50.65579 106.8982 51.72128 49.25184 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.34582 49.76856 51.3427 52.57378 49.91919 50.82039 50.09509 49.6801 col17 col18 col19 col20 row1 50.09481 50.52935 50.30398 105.845 > tmp[,"col10"] col10 row1 49.76856 row2 30.87449 row3 31.07678 row4 31.44613 row5 50.58705 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.36092 51.22001 52.21265 50.63899 50.65579 106.8982 51.72128 49.25184 row5 50.43131 49.56559 49.34345 49.14328 49.93734 104.2635 51.04350 49.93710 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.34582 49.76856 51.34270 52.57378 49.91919 50.82039 50.09509 49.68010 row5 50.24236 50.58705 49.69954 50.61192 51.31601 51.42117 50.80874 50.97588 col17 col18 col19 col20 row1 50.09481 50.52935 50.30398 105.8450 row5 49.85202 51.26791 49.10156 105.7896 > tmp[,c("col6","col20")] col6 col20 row1 106.89821 105.84497 row2 75.50259 75.71016 row3 78.04169 75.13508 row4 75.40752 74.38238 row5 104.26352 105.78961 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 106.8982 105.8450 row5 104.2635 105.7896 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 106.8982 105.8450 row5 104.2635 105.7896 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] 0.1773161 [2,] -0.2555274 [3,] -1.0394197 [4,] -0.6636776 [5,] 0.6709773 > tmp[,c("col17","col7")] col17 col7 [1,] 0.65332325 -0.5159110 [2,] -0.06297417 0.2450281 [3,] -0.51193613 -0.8175448 [4,] 0.07471561 -2.2274708 [5,] -0.91050326 0.1425867 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -0.1470946 0.2792019 [2,] -0.1510921 -2.5095093 [3,] -2.1909381 -0.3289042 [4,] 1.5933273 -1.1770716 [5,] -0.3417658 -1.8559269 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -0.1470946 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -0.1470946 [2,] -0.1510921 > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > > > > subBufferedMatrix(tmp,c("row3","row1"),)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row3 0.8986053 0.5990882 0.90847294 0.1259059 -0.4792195 -0.8670156 0.5158055 row1 -0.2839703 0.1896393 0.09317613 1.2021800 -0.2225007 -0.7070763 -1.2505758 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row3 -0.1377484 -0.1662626 0.82243141 0.4692832 0.3653752 0.2210081 0.2958434 row1 -1.2811051 -1.6363679 -0.03886705 0.5083244 -1.3771193 0.6930129 1.2603366 [,15] [,16] [,17] [,18] [,19] [,20] row3 0.8249993 -0.8536174 0.2892375 -0.05790444 1.5548005 0.2531703 row1 -0.3218972 0.8638930 1.2527422 0.84958980 0.5253182 -1.4906142 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] row2 1.284496 0.7119053 2.462346 2.77023 -0.3098808 1.212166 0.9504709 1.062252 [,9] [,10] row2 -0.3616728 0.929789 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -1.419275 0.9262842 1.558019 0.1490425 -1.242516 -1.723484 1.525987 [,8] [,9] [,10] [,11] [,12] [,13] row5 -0.6870097 -0.03314066 -0.3221459 -3.311175 -0.7869643 -0.1426989 [,14] [,15] [,16] [,17] [,18] [,19] [,20] row5 -0.3686341 -1.21517 1.561931 1.413698 0.03403619 1.151358 -0.3222389 > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > colnames(tmp) <- NULL > rownames(tmp) <- NULL > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > dimnames(tmp) [[1]] [1] "row1" "row2" "row3" "row4" "row5" [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > dimnames(tmp) <- NULL > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > dimnames(tmp) [[1]] NULL [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > > dimnames(tmp) <- NULL > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > dimnames(tmp) [[1]] [1] "row1" "row2" "row3" "row4" "row5" [[2]] NULL > > dimnames(tmp) <- list(NULL,c(colnames(tmp,do.NULL=FALSE))) > dimnames(tmp) [[1]] NULL [[2]] [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > > > > ### > ### Testing logical indexing > ### > ### > > tmp <- createBufferedMatrix(230,15) > tmp[1:230,1:15] <- rnorm(230*15) > x <-tmp[1:230,1:15] > > for (rep in 1:10){ + which.cols <- sample(c(TRUE,FALSE),15,replace=T) + which.rows <- sample(c(TRUE,FALSE),230,replace=T) + + if (!all(tmp[which.rows,which.cols] == x[which.rows,which.cols])){ + stop("No agreement when logical indexing\n") + } + + if (!all(subBufferedMatrix(tmp,,which.cols)[,1:sum(which.cols)] == x[,which.cols])){ + stop("No agreement when logical indexing in subBufferedMatrix cols\n") + } + if (!all(subBufferedMatrix(tmp,which.rows,)[1:sum(which.rows),] == x[which.rows,])){ + stop("No agreement when logical indexing in subBufferedMatrix rows\n") + } + + + if (!all(subBufferedMatrix(tmp,which.rows,which.cols)[1:sum(which.rows),1:sum(which.cols)]== x[which.rows,which.cols])){ + stop("No agreement when logical indexing in subBufferedMatrix rows and columns\n") + } + } > > > ## > ## Test the ReadOnlyMode > ## > > ReadOnlyMode(tmp) <pointer: 0x600003b6c000> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d334dcf1f9f" [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d33592527a1" [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d33164ce8c0" [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d331344a0b0" [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d337e918cb1" [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d335abf962" [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d335d8193d6" [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d336610f68f" [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d3363ab5aa2" [10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d336cb74cd" [11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d3317614237" [12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d33724234de" [13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d33589d156c" [14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d3330e992e7" [15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1d3336ab94c7" > > > ### testing coercion functions > ### > > tmp <- as(tmp,"matrix") > tmp <- as(tmp,"BufferedMatrix") > > > > ### testing whether can move storage from one location to another > > MoveStorageDirectory(tmp,"NewDirectory",full.path=FALSE) <pointer: 0x600003b18120> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x600003b18120> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x600003b18120> > rowMedians(tmp) [1] -0.3278848486 0.1845375531 -0.1134776069 -0.3127802178 -0.1833452836 [6] -0.1706397528 0.5392167456 0.3507524226 0.1212135441 -0.2221757718 [11] 0.0984199937 0.0309428567 0.0454099468 0.3463253264 -0.3932349365 [16] 0.0423328112 0.2058493098 -0.3620437469 -0.2350868946 0.1526817697 [21] -0.1033710489 -0.6966761207 0.9422399383 0.5093458703 0.6831279105 [26] 0.2390738879 0.4443918841 -0.2612996684 -0.0155128422 0.0203724799 [31] 0.4228964654 0.3534881846 -0.2663739284 -0.4628934045 0.0194025937 [36] 0.2418689366 0.3413008788 0.0587105024 -0.3676316134 -0.1298821700 [41] -0.4416754731 0.2265500923 0.0220053899 0.3864883890 0.3835065563 [46] 0.0650789137 -0.1979931994 -0.2908445746 -0.2884322618 0.0433406889 [51] -0.0625423599 -0.4049961817 0.0233712553 -0.5057209200 0.3705720267 [56] -0.5876464446 -0.0007898461 0.1228673405 -0.3076391113 -0.5477890732 [61] -0.2523804608 -0.0032082262 0.4744470938 0.1820362667 0.0998370313 [66] -0.1223724501 -0.2476930411 -0.3515636239 -0.6043372099 0.3447385157 [71] -0.5297124801 0.3521764740 0.1935179609 0.1372224184 0.2450274813 [76] -0.4373160020 0.1614842026 0.0669681370 -0.1101448187 -0.3392084666 [81] -0.4521449686 -0.2509376089 -0.2332034152 0.1117998438 0.3621985322 [86] -0.0921318142 -0.0153958507 -0.2011142794 0.3912682765 0.0657813723 [91] 0.1904719893 0.0242411499 -0.3107509269 0.2309203159 0.2990899013 [96] 0.3529864146 0.1096010814 0.0149739521 0.2760274225 -0.3241430997 [101] 0.5209347780 0.0916919434 -0.2142077479 0.3129899834 0.0871415187 [106] 0.1101900782 0.2301949163 0.0232240428 -0.0966620227 -0.2719116843 [111] 0.6833863958 0.1546584815 0.1449184158 -0.1576802378 -0.3474401240 [116] -0.1301859562 -0.1105067192 -0.3575501035 -0.6797336801 -0.1318037391 [121] 0.3477562728 0.0049387998 -0.4860968692 0.5249346965 -0.0206919782 [126] 0.6913699029 0.1838728558 -0.2658448771 -0.2869058605 0.0162524226 [131] -0.2810252047 -0.0254680837 0.3472555013 0.0257718238 0.1322520178 [136] -0.6371077646 0.0824555932 -0.4249311023 -0.4651651967 -0.5962536702 [141] 0.0486134457 0.1901634712 -0.0708727258 0.1255303776 -0.4240840289 [146] -0.0193804384 0.1063593904 -0.3084811945 -0.1842907341 -0.5552829508 [151] -0.2244113103 0.2987481845 -0.2510630007 0.3830951097 -0.1864399016 [156] -0.0246987213 0.4068741834 0.2107246968 0.6846804345 0.3611361880 [161] 0.0626091453 -0.1045057161 0.1228579943 -0.0255389305 -0.3501674817 [166] -0.0774454030 -0.1215580617 -0.3468843020 -0.1814319687 -0.1518749753 [171] 0.2883457857 -0.2856946009 0.6448530084 -0.2494987225 -0.0059644897 [176] 0.0852620712 -0.2513592956 -0.5006077386 0.1216452639 -0.6349317372 [181] -0.2824559929 -0.3027310605 0.1482283472 0.1473439651 0.4727278341 [186] -0.1067741105 -0.0080770970 0.6393030501 -0.2152020926 -0.2979454795 [191] -0.2826409076 -0.3571902284 0.2769234390 0.3619861153 -0.5262903351 [196] 0.1466048354 -0.4109755862 -0.3841970216 -0.0265478264 -0.0294043553 [201] 0.0191762697 -0.4246773858 -0.3254658753 -0.2476270066 0.1277464136 [206] -0.1436369602 -0.3325608271 -0.2277156362 0.1738290450 -0.0455528105 [211] -0.1775265260 0.2365734135 0.1669034896 0.4303639924 -0.1760186848 [216] 0.1366636138 0.0014879174 0.1259643677 0.0167923751 -0.0398553921 [221] -0.2256338195 0.2757187716 -0.2473919362 -0.2541233316 0.2429158487 [226] 0.3887902336 0.0252569358 0.0545755484 0.4523886284 0.0915449754 > > proc.time() user system elapsed 5.097 19.133 28.110
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.1 RC (2025-06-05 r88288) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > prefix <- "dbmtest" > directory <- getwd() > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001e18000> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001e18000> > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 10 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001e18000> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 10 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 1.000000 2.000000 3.000000 4.000000 5.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2.000000 3.000000 4.000000 5.000000 6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 3.000000 4.000000 5.000000 6.000000 7.000000 0.000000 0.000000 0.000000 0.000000 0.000000 4.000000 5.000000 6.000000 7.000000 8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e18000> > rm(P) > > #P <- .Call("R_bm_Destroy",P) > #.Call("R_bm_Destroy",P) > #.Call("R_bm_Test_C",P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,5) [1] TRUE > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 0 Buffer Rows: 1 Buffer Cols: 1 Printing Values <pointer: 0x600001e04000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e04000> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 1 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e04000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e04000> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e04000> > rm(P) > > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,5) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001e1c300> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e1c300> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e1c300> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001e1c300> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e1c300> > > .Call("R_bm_RowMode",P) <pointer: 0x600001e1c300> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e1c300> > > .Call("R_bm_ColMode",P) <pointer: 0x600001e1c300> > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 2 Buffer Rows: 5 Buffer Cols: 5 Printing Values 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 <pointer: 0x600001e1c300> > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30000> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x600001e30000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30000> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile22622ca9018f" "BufferedMatrixFile2262ba56a31" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile22622ca9018f" "BufferedMatrixFile2262ba56a31" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30240> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30240> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001e30240> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001e30240> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x600001e30240> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x600001e30240> > .Call("R_bm_isRowMode",P) [1] FALSE > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30420> > .Call("R_bm_AddColumn",P) <pointer: 0x600001e30420> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001e30420> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x600001e30420> > rm(P) > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_Test_C",P) RBufferedMatrix Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Assigning Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 6.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001e30600> > .Call("R_bm_getValue",P,3,3) [1] 6 > > .Call("R_bm_getValue",P,100000,10000) [1] NA > .Call("R_bm_setValue",P,3,3,12345.0) [1] TRUE > .Call("R_bm_Test_C2",P) Checking dimensions Rows: 5 Cols: 5 Buffer Rows: 1 Buffer Cols: 1 Printing Values 0.000000 1.000000 2.000000 3.000000 4.000000 1.000000 2.000000 3.000000 4.000000 5.000000 2.000000 3.000000 4.000000 5.000000 6.000000 3.000000 4.000000 5.000000 12345.000000 7.000000 4.000000 5.000000 6.000000 7.000000 8.000000 <pointer: 0x600001e30600> > rm(P) > > proc.time() user system elapsed 0.589 0.217 0.787
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.1 RC (2025-06-05 r88288) -- "Great Square Root" Copyright (C) 2025 The R Foundation for Statistical Computing Platform: x86_64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > Temp <- createBufferedMatrix(100) > dim(Temp) [1] 100 0 > buffer.dim(Temp) [1] 1 1 > > > proc.time() user system elapsed 0.591 0.139 0.722