Back to Multiple platform build/check report for BioC 3.20: simplified long |
|
This page was generated on 2025-03-27 12:08 -0400 (Thu, 27 Mar 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo2 | Linux (Ubuntu 24.04.1 LTS) | x86_64 | 4.4.3 (2025-02-28) -- "Trophy Case" | 4764 |
palomino8 | Windows Server 2022 Datacenter | x64 | 4.4.3 (2025-02-28 ucrt) -- "Trophy Case" | 4495 |
merida1 | macOS 12.7.5 Monterey | x86_64 | 4.4.3 (2025-02-28) -- "Trophy Case" | 4522 |
kjohnson1 | macOS 13.6.6 Ventura | arm64 | 4.4.3 (2025-02-28) -- "Trophy Case" | 4449 |
taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.4.3 (2025-02-28) -- "Trophy Case" | 4420 |
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 251/2289 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.70.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.1 LTS) / x86_64 | OK | OK | OK | ![]() | ||||||||
palomino8 | Windows Server 2022 Datacenter / x64 | OK | 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 | ![]() | ||||||||
taishan | 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.70.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.70.0.tar.gz |
StartedAt: 2025-03-25 00:15:58 -0400 (Tue, 25 Mar 2025) |
EndedAt: 2025-03-25 00:17:13 -0400 (Tue, 25 Mar 2025) |
EllapsedTime: 75.0 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.70.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.4.3 (2025-02-28) * using platform: x86_64-apple-darwin20 * R was compiled by Apple clang version 14.0.0 (clang-1400.0.29.202) GNU Fortran (GCC) 12.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.70.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.20-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.20-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.4-x86_64/Resources/library’ * installing *source* package ‘BufferedMatrix’ ... ** 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 -Wl,-framework -Wl,CoreFoundation installing to /Library/Frameworks/R.framework/Versions/4.4-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.4.3 (2025-02-28) -- "Trophy Case" 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.581 0.212 1.019
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.4.3 (2025-02-28) -- "Trophy Case" 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.20-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 473668 25.3 1034025 55.3 NA 638622 34.2 Vcells 877290 6.7 8388608 64.0 65536 2072022 15.9 > > > > > ## > ## 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 Mar 25 00:16:33 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 Mar 25 00:16:34 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: 0x6000010b02a0> > > > > 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 Mar 25 00:16:40 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 Mar 25 00:16:43 2025" > > ColMode(tmp2) <pointer: 0x6000010b02a0> > > > > ### 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.6853517 0.8102115 0.38982101 -0.4584924 [2,] 0.9451770 -0.1455817 -1.42008494 -0.8487021 [3,] 0.7748063 -2.1686984 0.05457393 -0.5232495 [4,] -1.2442535 0.9898259 1.32025252 -0.6325364 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 99.6853517 0.8102115 0.38982101 0.4584924 [2,] 0.9451770 0.1455817 1.42008494 0.8487021 [3,] 0.7748063 2.1686984 0.05457393 0.5232495 [4,] 1.2442535 0.9898259 1.32025252 0.6325364 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 9.9842552 0.9001175 0.6243565 0.6771206 [2,] 0.9722021 0.3815517 1.1916732 0.9212503 [3,] 0.8802308 1.4726501 0.2336106 0.7233599 [4,] 1.1154611 0.9948999 1.1490224 0.7953215 > > 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.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 224.52790 34.81139 31.63339 32.22970 [2,] 35.66720 28.96110 38.33682 35.06120 [3,] 34.57711 41.89520 27.39068 32.75685 [4,] 37.39886 35.93883 37.81048 33.58575 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x60000108c000> > exp(tmp5) <pointer: 0x60000108c000> > log(tmp5,2) <pointer: 0x60000108c000> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 467.3254 > Min(tmp5) [1] 56.04589 > mean(tmp5) [1] 72.30749 > Sum(tmp5) [1] 14461.5 > Var(tmp5) [1] 855.8266 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 90.08615 70.59478 70.20420 72.83445 69.98654 69.27870 73.93418 67.91374 [9] 69.67207 68.57004 > rowSums(tmp5) [1] 1801.723 1411.896 1404.084 1456.689 1399.731 1385.574 1478.684 1358.275 [9] 1393.441 1371.401 > rowVars(tmp5) [1] 7939.63747 58.53600 77.99185 51.25130 69.65498 81.54168 [7] 117.29286 54.09534 75.56985 36.88460 > rowSd(tmp5) [1] 89.104643 7.650882 8.831300 7.159001 8.345956 9.030043 10.830183 [8] 7.354953 8.693092 6.073270 > rowMax(tmp5) [1] 467.32541 84.98967 87.19937 86.30323 83.04567 92.07606 93.90156 [8] 87.89886 84.62115 81.17764 > rowMin(tmp5) [1] 58.03053 57.46819 56.36492 56.04589 58.08831 58.34710 59.17308 59.69826 [9] 57.09530 58.98796 > > colMeans(tmp5) [1] 112.57622 71.54133 72.57061 68.04007 69.53363 67.79846 70.57897 [8] 67.18239 68.92251 73.83933 68.47661 69.03511 71.28204 74.59992 [15] 70.21529 69.99367 69.27742 69.59152 69.85868 71.23594 > colSums(tmp5) [1] 1125.7622 715.4133 725.7061 680.4007 695.3363 677.9846 705.7897 [8] 671.8239 689.2251 738.3933 684.7661 690.3511 712.8204 745.9992 [15] 702.1529 699.9367 692.7742 695.9152 698.5868 712.3594 > colVars(tmp5) [1] 15570.36750 110.22369 96.28799 72.00578 104.10556 59.19094 [7] 96.34575 106.64434 86.01040 84.10705 50.18357 32.55243 [13] 56.59748 60.87875 13.61978 89.13404 54.25636 71.99197 [19] 50.62419 84.09614 > colSd(tmp5) [1] 124.781279 10.498747 9.812644 8.485622 10.203213 7.693565 [7] 9.815587 10.326875 9.274179 9.170989 7.084036 5.705474 [13] 7.523130 7.802483 3.690498 9.441082 7.365892 8.484808 [19] 7.115068 9.170395 > colMax(tmp5) [1] 467.32541 87.19937 84.62115 87.89886 92.07606 83.48962 86.30323 [8] 93.90156 87.10504 87.24576 78.20182 76.71323 86.20523 84.77288 [15] 74.94037 88.44318 79.14302 82.94421 79.41742 87.16866 > colMin(tmp5) [1] 63.49694 57.85428 57.01011 58.25529 58.03053 59.15147 57.22532 56.04589 [9] 58.08831 59.69826 58.34710 60.19302 61.20482 63.03586 65.93082 56.36492 [17] 59.17308 57.46819 58.98796 57.09530 > > > ### 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] 90.08615 70.59478 70.20420 72.83445 69.98654 NA 73.93418 67.91374 [9] 69.67207 68.57004 > rowSums(tmp5) [1] 1801.723 1411.896 1404.084 1456.689 1399.731 NA 1478.684 1358.275 [9] 1393.441 1371.401 > rowVars(tmp5) [1] 7939.63747 58.53600 77.99185 51.25130 69.65498 81.76134 [7] 117.29286 54.09534 75.56985 36.88460 > rowSd(tmp5) [1] 89.104643 7.650882 8.831300 7.159001 8.345956 9.042198 10.830183 [8] 7.354953 8.693092 6.073270 > rowMax(tmp5) [1] 467.32541 84.98967 87.19937 86.30323 83.04567 NA 93.90156 [8] 87.89886 84.62115 81.17764 > rowMin(tmp5) [1] 58.03053 57.46819 56.36492 56.04589 58.08831 NA 59.17308 59.69826 [9] 57.09530 58.98796 > > colMeans(tmp5) [1] 112.57622 71.54133 72.57061 NA 69.53363 67.79846 70.57897 [8] 67.18239 68.92251 73.83933 68.47661 69.03511 71.28204 74.59992 [15] 70.21529 69.99367 69.27742 69.59152 69.85868 71.23594 > colSums(tmp5) [1] 1125.7622 715.4133 725.7061 NA 695.3363 677.9846 705.7897 [8] 671.8239 689.2251 738.3933 684.7661 690.3511 712.8204 745.9992 [15] 702.1529 699.9367 692.7742 695.9152 698.5868 712.3594 > colVars(tmp5) [1] 15570.36750 110.22369 96.28799 NA 104.10556 59.19094 [7] 96.34575 106.64434 86.01040 84.10705 50.18357 32.55243 [13] 56.59748 60.87875 13.61978 89.13404 54.25636 71.99197 [19] 50.62419 84.09614 > colSd(tmp5) [1] 124.781279 10.498747 9.812644 NA 10.203213 7.693565 [7] 9.815587 10.326875 9.274179 9.170989 7.084036 5.705474 [13] 7.523130 7.802483 3.690498 9.441082 7.365892 8.484808 [19] 7.115068 9.170395 > colMax(tmp5) [1] 467.32541 87.19937 84.62115 NA 92.07606 83.48962 86.30323 [8] 93.90156 87.10504 87.24576 78.20182 76.71323 86.20523 84.77288 [15] 74.94037 88.44318 79.14302 82.94421 79.41742 87.16866 > colMin(tmp5) [1] 63.49694 57.85428 57.01011 NA 58.03053 59.15147 57.22532 56.04589 [9] 58.08831 59.69826 58.34710 60.19302 61.20482 63.03586 65.93082 56.36492 [17] 59.17308 57.46819 58.98796 57.09530 > > Max(tmp5,na.rm=TRUE) [1] 467.3254 > Min(tmp5,na.rm=TRUE) [1] 56.04589 > mean(tmp5,na.rm=TRUE) [1] 72.36585 > Sum(tmp5,na.rm=TRUE) [1] 14400.8 > Var(tmp5,na.rm=TRUE) [1] 859.4642 > > rowMeans(tmp5,na.rm=TRUE) [1] 90.08615 70.59478 70.20420 72.83445 69.98654 69.73056 73.93418 67.91374 [9] 69.67207 68.57004 > rowSums(tmp5,na.rm=TRUE) [1] 1801.723 1411.896 1404.084 1456.689 1399.731 1324.881 1478.684 1358.275 [9] 1393.441 1371.401 > rowVars(tmp5,na.rm=TRUE) [1] 7939.63747 58.53600 77.99185 51.25130 69.65498 81.76134 [7] 117.29286 54.09534 75.56985 36.88460 > rowSd(tmp5,na.rm=TRUE) [1] 89.104643 7.650882 8.831300 7.159001 8.345956 9.042198 10.830183 [8] 7.354953 8.693092 6.073270 > rowMax(tmp5,na.rm=TRUE) [1] 467.32541 84.98967 87.19937 86.30323 83.04567 92.07606 93.90156 [8] 87.89886 84.62115 81.17764 > rowMin(tmp5,na.rm=TRUE) [1] 58.03053 57.46819 56.36492 56.04589 58.08831 58.34710 59.17308 59.69826 [9] 57.09530 58.98796 > > colMeans(tmp5,na.rm=TRUE) [1] 112.57622 71.54133 72.57061 68.85638 69.53363 67.79846 70.57897 [8] 67.18239 68.92251 73.83933 68.47661 69.03511 71.28204 74.59992 [15] 70.21529 69.99367 69.27742 69.59152 69.85868 71.23594 > colSums(tmp5,na.rm=TRUE) [1] 1125.7622 715.4133 725.7061 619.7074 695.3363 677.9846 705.7897 [8] 671.8239 689.2251 738.3933 684.7661 690.3511 712.8204 745.9992 [15] 702.1529 699.9367 692.7742 695.9152 698.5868 712.3594 > colVars(tmp5,na.rm=TRUE) [1] 15570.36750 110.22369 96.28799 73.51004 104.10556 59.19094 [7] 96.34575 106.64434 86.01040 84.10705 50.18357 32.55243 [13] 56.59748 60.87875 13.61978 89.13404 54.25636 71.99197 [19] 50.62419 84.09614 > colSd(tmp5,na.rm=TRUE) [1] 124.781279 10.498747 9.812644 8.573800 10.203213 7.693565 [7] 9.815587 10.326875 9.274179 9.170989 7.084036 5.705474 [13] 7.523130 7.802483 3.690498 9.441082 7.365892 8.484808 [19] 7.115068 9.170395 > colMax(tmp5,na.rm=TRUE) [1] 467.32541 87.19937 84.62115 87.89886 92.07606 83.48962 86.30323 [8] 93.90156 87.10504 87.24576 78.20182 76.71323 86.20523 84.77288 [15] 74.94037 88.44318 79.14302 82.94421 79.41742 87.16866 > colMin(tmp5,na.rm=TRUE) [1] 63.49694 57.85428 57.01011 58.25529 58.03053 59.15147 57.22532 56.04589 [9] 58.08831 59.69826 58.34710 60.19302 61.20482 63.03586 65.93082 56.36492 [17] 59.17308 57.46819 58.98796 57.09530 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 90.08615 70.59478 70.20420 72.83445 69.98654 NaN 73.93418 67.91374 [9] 69.67207 68.57004 > rowSums(tmp5,na.rm=TRUE) [1] 1801.723 1411.896 1404.084 1456.689 1399.731 0.000 1478.684 1358.275 [9] 1393.441 1371.401 > rowVars(tmp5,na.rm=TRUE) [1] 7939.63747 58.53600 77.99185 51.25130 69.65498 NA [7] 117.29286 54.09534 75.56985 36.88460 > rowSd(tmp5,na.rm=TRUE) [1] 89.104643 7.650882 8.831300 7.159001 8.345956 NA 10.830183 [8] 7.354953 8.693092 6.073270 > rowMax(tmp5,na.rm=TRUE) [1] 467.32541 84.98967 87.19937 86.30323 83.04567 NA 93.90156 [8] 87.89886 84.62115 81.17764 > rowMin(tmp5,na.rm=TRUE) [1] 58.03053 57.46819 56.36492 56.04589 58.08831 NA 59.17308 59.69826 [9] 57.09530 58.98796 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 117.04471 72.50490 72.12837 NaN 67.02891 68.65523 70.88447 [8] 67.78686 69.35502 72.85746 69.60211 68.68634 70.62660 74.44428 [15] 70.62146 70.21745 70.23385 69.94353 71.00353 70.39891 > colSums(tmp5,na.rm=TRUE) [1] 1053.4024 652.5441 649.1553 0.0000 603.2602 617.8971 637.9602 [8] 610.0817 624.1952 655.7171 626.4190 618.1771 635.6394 669.9985 [15] 635.5931 631.9571 632.1047 629.4918 639.0317 633.5902 > colVars(tmp5,na.rm=TRUE) [1] 17292.03044 113.55648 106.12376 NA 46.54080 58.33170 [7] 107.33898 115.86431 94.65721 83.77468 42.20554 35.25302 [13] 58.83908 68.21605 13.46626 99.71241 50.74723 79.59696 [19] 42.20718 86.72625 > colSd(tmp5,na.rm=TRUE) [1] 131.499165 10.656288 10.301639 NA 6.822082 7.637519 [7] 10.360453 10.764028 9.729194 9.152851 6.496579 5.937425 [13] 7.670664 8.259301 3.669641 9.985610 7.123709 8.921713 [19] 6.496705 9.312693 > colMax(tmp5,na.rm=TRUE) [1] 467.32541 87.19937 84.62115 -Inf 79.55218 83.48962 86.30323 [8] 93.90156 87.10504 87.24576 78.20182 76.71323 86.20523 84.77288 [15] 74.94037 88.44318 79.14302 82.94421 79.41742 87.16866 > colMin(tmp5,na.rm=TRUE) [1] 63.49694 57.85428 57.01011 Inf 58.03053 59.15147 57.22532 56.04589 [9] 58.08831 59.69826 60.66195 60.19302 61.20482 63.03586 65.93082 56.36492 [17] 59.17308 57.46819 58.98796 57.09530 > > > > > 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] 242.3198 266.4787 415.9017 205.5960 190.5883 155.6001 198.5698 134.6069 [9] 210.4650 142.4409 > apply(copymatrix,1,var,na.rm=TRUE) [1] 242.3198 266.4787 415.9017 205.5960 190.5883 155.6001 198.5698 134.6069 [9] 210.4650 142.4409 > > > > 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] -2.842171e-14 0.000000e+00 -1.136868e-13 -1.136868e-13 -1.705303e-13 [6] -1.136868e-13 2.842171e-14 5.684342e-14 3.126388e-13 -1.136868e-13 [11] 1.421085e-14 5.684342e-14 1.136868e-13 -1.136868e-13 0.000000e+00 [16] 0.000000e+00 8.526513e-14 -1.563194e-13 2.842171e-14 0.000000e+00 > > > > > > > > > > > ## 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 17 10 8 7 17 6 9 7 16 3 10 5 15 5 12 1 6 5 16 5 6 8 2 5 13 7 14 8 17 7 3 2 5 8 8 7 5 9 13 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] 1.942476 > Min(tmp) [1] -2.487054 > mean(tmp) [1] -0.03090612 > Sum(tmp) [1] -3.090612 > Var(tmp) [1] 0.7843551 > > rowMeans(tmp) [1] -0.03090612 > rowSums(tmp) [1] -3.090612 > rowVars(tmp) [1] 0.7843551 > rowSd(tmp) [1] 0.8856382 > rowMax(tmp) [1] 1.942476 > rowMin(tmp) [1] -2.487054 > > colMeans(tmp) [1] 0.289480674 -0.015818791 1.381898262 0.009832649 -0.355620689 [6] 1.207360879 -0.515372916 -0.424841109 -2.487053940 0.212865857 [11] -1.002716349 -1.202616502 1.127943045 0.231662458 0.759831105 [16] 1.255909465 0.068784098 0.414918686 -0.698474316 0.037735656 [21] -1.496724201 -0.106032243 -0.454332062 -0.608156187 -1.275421499 [26] -0.936672231 0.449469295 -0.115374633 -0.557928107 1.590233952 [31] 0.440131269 -0.142526969 -0.462694484 0.946528770 0.611301467 [36] 0.109037557 0.226423621 0.740728774 -0.918824955 -1.760983181 [41] -0.869952088 1.471702146 0.415482964 -0.555304626 -0.699775758 [46] 0.156769421 -0.616728718 1.454242255 0.412470009 0.197348451 [51] 0.528286716 0.135923507 0.376620229 0.173690598 -0.888784528 [56] -0.914829693 0.978968880 0.097268888 0.535702708 -0.205803992 [61] -1.839383487 -0.336841161 0.995265261 1.209199184 -1.688121496 [66] -1.417940786 1.942476434 0.798099917 -0.164005752 0.468674020 [71] -0.981301322 -0.327206770 0.721665476 0.474176180 -0.487291495 [76] -0.902853853 -0.109289770 0.965532041 -0.062846344 -1.637923177 [81] 0.126353430 0.230147586 0.728034819 1.603205488 -0.222220126 [86] 0.811231844 -2.152209402 -0.043071357 -0.138190967 0.457226157 [91] -0.354621133 -0.282515821 0.760367544 -0.697056572 -1.313791643 [96] -0.016574331 0.772045674 -0.414199475 -0.537842066 1.215795897 > colSums(tmp) [1] 0.289480674 -0.015818791 1.381898262 0.009832649 -0.355620689 [6] 1.207360879 -0.515372916 -0.424841109 -2.487053940 0.212865857 [11] -1.002716349 -1.202616502 1.127943045 0.231662458 0.759831105 [16] 1.255909465 0.068784098 0.414918686 -0.698474316 0.037735656 [21] -1.496724201 -0.106032243 -0.454332062 -0.608156187 -1.275421499 [26] -0.936672231 0.449469295 -0.115374633 -0.557928107 1.590233952 [31] 0.440131269 -0.142526969 -0.462694484 0.946528770 0.611301467 [36] 0.109037557 0.226423621 0.740728774 -0.918824955 -1.760983181 [41] -0.869952088 1.471702146 0.415482964 -0.555304626 -0.699775758 [46] 0.156769421 -0.616728718 1.454242255 0.412470009 0.197348451 [51] 0.528286716 0.135923507 0.376620229 0.173690598 -0.888784528 [56] -0.914829693 0.978968880 0.097268888 0.535702708 -0.205803992 [61] -1.839383487 -0.336841161 0.995265261 1.209199184 -1.688121496 [66] -1.417940786 1.942476434 0.798099917 -0.164005752 0.468674020 [71] -0.981301322 -0.327206770 0.721665476 0.474176180 -0.487291495 [76] -0.902853853 -0.109289770 0.965532041 -0.062846344 -1.637923177 [81] 0.126353430 0.230147586 0.728034819 1.603205488 -0.222220126 [86] 0.811231844 -2.152209402 -0.043071357 -0.138190967 0.457226157 [91] -0.354621133 -0.282515821 0.760367544 -0.697056572 -1.313791643 [96] -0.016574331 0.772045674 -0.414199475 -0.537842066 1.215795897 > 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.289480674 -0.015818791 1.381898262 0.009832649 -0.355620689 [6] 1.207360879 -0.515372916 -0.424841109 -2.487053940 0.212865857 [11] -1.002716349 -1.202616502 1.127943045 0.231662458 0.759831105 [16] 1.255909465 0.068784098 0.414918686 -0.698474316 0.037735656 [21] -1.496724201 -0.106032243 -0.454332062 -0.608156187 -1.275421499 [26] -0.936672231 0.449469295 -0.115374633 -0.557928107 1.590233952 [31] 0.440131269 -0.142526969 -0.462694484 0.946528770 0.611301467 [36] 0.109037557 0.226423621 0.740728774 -0.918824955 -1.760983181 [41] -0.869952088 1.471702146 0.415482964 -0.555304626 -0.699775758 [46] 0.156769421 -0.616728718 1.454242255 0.412470009 0.197348451 [51] 0.528286716 0.135923507 0.376620229 0.173690598 -0.888784528 [56] -0.914829693 0.978968880 0.097268888 0.535702708 -0.205803992 [61] -1.839383487 -0.336841161 0.995265261 1.209199184 -1.688121496 [66] -1.417940786 1.942476434 0.798099917 -0.164005752 0.468674020 [71] -0.981301322 -0.327206770 0.721665476 0.474176180 -0.487291495 [76] -0.902853853 -0.109289770 0.965532041 -0.062846344 -1.637923177 [81] 0.126353430 0.230147586 0.728034819 1.603205488 -0.222220126 [86] 0.811231844 -2.152209402 -0.043071357 -0.138190967 0.457226157 [91] -0.354621133 -0.282515821 0.760367544 -0.697056572 -1.313791643 [96] -0.016574331 0.772045674 -0.414199475 -0.537842066 1.215795897 > colMin(tmp) [1] 0.289480674 -0.015818791 1.381898262 0.009832649 -0.355620689 [6] 1.207360879 -0.515372916 -0.424841109 -2.487053940 0.212865857 [11] -1.002716349 -1.202616502 1.127943045 0.231662458 0.759831105 [16] 1.255909465 0.068784098 0.414918686 -0.698474316 0.037735656 [21] -1.496724201 -0.106032243 -0.454332062 -0.608156187 -1.275421499 [26] -0.936672231 0.449469295 -0.115374633 -0.557928107 1.590233952 [31] 0.440131269 -0.142526969 -0.462694484 0.946528770 0.611301467 [36] 0.109037557 0.226423621 0.740728774 -0.918824955 -1.760983181 [41] -0.869952088 1.471702146 0.415482964 -0.555304626 -0.699775758 [46] 0.156769421 -0.616728718 1.454242255 0.412470009 0.197348451 [51] 0.528286716 0.135923507 0.376620229 0.173690598 -0.888784528 [56] -0.914829693 0.978968880 0.097268888 0.535702708 -0.205803992 [61] -1.839383487 -0.336841161 0.995265261 1.209199184 -1.688121496 [66] -1.417940786 1.942476434 0.798099917 -0.164005752 0.468674020 [71] -0.981301322 -0.327206770 0.721665476 0.474176180 -0.487291495 [76] -0.902853853 -0.109289770 0.965532041 -0.062846344 -1.637923177 [81] 0.126353430 0.230147586 0.728034819 1.603205488 -0.222220126 [86] 0.811231844 -2.152209402 -0.043071357 -0.138190967 0.457226157 [91] -0.354621133 -0.282515821 0.760367544 -0.697056572 -1.313791643 [96] -0.016574331 0.772045674 -0.414199475 -0.537842066 1.215795897 > colMedians(tmp) [1] 0.289480674 -0.015818791 1.381898262 0.009832649 -0.355620689 [6] 1.207360879 -0.515372916 -0.424841109 -2.487053940 0.212865857 [11] -1.002716349 -1.202616502 1.127943045 0.231662458 0.759831105 [16] 1.255909465 0.068784098 0.414918686 -0.698474316 0.037735656 [21] -1.496724201 -0.106032243 -0.454332062 -0.608156187 -1.275421499 [26] -0.936672231 0.449469295 -0.115374633 -0.557928107 1.590233952 [31] 0.440131269 -0.142526969 -0.462694484 0.946528770 0.611301467 [36] 0.109037557 0.226423621 0.740728774 -0.918824955 -1.760983181 [41] -0.869952088 1.471702146 0.415482964 -0.555304626 -0.699775758 [46] 0.156769421 -0.616728718 1.454242255 0.412470009 0.197348451 [51] 0.528286716 0.135923507 0.376620229 0.173690598 -0.888784528 [56] -0.914829693 0.978968880 0.097268888 0.535702708 -0.205803992 [61] -1.839383487 -0.336841161 0.995265261 1.209199184 -1.688121496 [66] -1.417940786 1.942476434 0.798099917 -0.164005752 0.468674020 [71] -0.981301322 -0.327206770 0.721665476 0.474176180 -0.487291495 [76] -0.902853853 -0.109289770 0.965532041 -0.062846344 -1.637923177 [81] 0.126353430 0.230147586 0.728034819 1.603205488 -0.222220126 [86] 0.811231844 -2.152209402 -0.043071357 -0.138190967 0.457226157 [91] -0.354621133 -0.282515821 0.760367544 -0.697056572 -1.313791643 [96] -0.016574331 0.772045674 -0.414199475 -0.537842066 1.215795897 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2894807 -0.01581879 1.381898 0.009832649 -0.3556207 1.207361 -0.5153729 [2,] 0.2894807 -0.01581879 1.381898 0.009832649 -0.3556207 1.207361 -0.5153729 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.4248411 -2.487054 0.2128659 -1.002716 -1.202617 1.127943 0.2316625 [2,] -0.4248411 -2.487054 0.2128659 -1.002716 -1.202617 1.127943 0.2316625 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 0.7598311 1.255909 0.0687841 0.4149187 -0.6984743 0.03773566 -1.496724 [2,] 0.7598311 1.255909 0.0687841 0.4149187 -0.6984743 0.03773566 -1.496724 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.1060322 -0.4543321 -0.6081562 -1.275421 -0.9366722 0.4494693 -0.1153746 [2,] -0.1060322 -0.4543321 -0.6081562 -1.275421 -0.9366722 0.4494693 -0.1153746 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.5579281 1.590234 0.4401313 -0.142527 -0.4626945 0.9465288 0.6113015 [2,] -0.5579281 1.590234 0.4401313 -0.142527 -0.4626945 0.9465288 0.6113015 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 0.1090376 0.2264236 0.7407288 -0.918825 -1.760983 -0.8699521 1.471702 [2,] 0.1090376 0.2264236 0.7407288 -0.918825 -1.760983 -0.8699521 1.471702 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 0.415483 -0.5553046 -0.6997758 0.1567694 -0.6167287 1.454242 0.41247 [2,] 0.415483 -0.5553046 -0.6997758 0.1567694 -0.6167287 1.454242 0.41247 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] 0.1973485 0.5282867 0.1359235 0.3766202 0.1736906 -0.8887845 -0.9148297 [2,] 0.1973485 0.5282867 0.1359235 0.3766202 0.1736906 -0.8887845 -0.9148297 [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] 0.9789689 0.09726889 0.5357027 -0.205804 -1.839383 -0.3368412 0.9952653 [2,] 0.9789689 0.09726889 0.5357027 -0.205804 -1.839383 -0.3368412 0.9952653 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [1,] 1.209199 -1.688121 -1.417941 1.942476 0.7980999 -0.1640058 0.468674 [2,] 1.209199 -1.688121 -1.417941 1.942476 0.7980999 -0.1640058 0.468674 [,71] [,72] [,73] [,74] [,75] [,76] [,77] [1,] -0.9813013 -0.3272068 0.7216655 0.4741762 -0.4872915 -0.9028539 -0.1092898 [2,] -0.9813013 -0.3272068 0.7216655 0.4741762 -0.4872915 -0.9028539 -0.1092898 [,78] [,79] [,80] [,81] [,82] [,83] [,84] [1,] 0.965532 -0.06284634 -1.637923 0.1263534 0.2301476 0.7280348 1.603205 [2,] 0.965532 -0.06284634 -1.637923 0.1263534 0.2301476 0.7280348 1.603205 [,85] [,86] [,87] [,88] [,89] [,90] [,91] [1,] -0.2222201 0.8112318 -2.152209 -0.04307136 -0.138191 0.4572262 -0.3546211 [2,] -0.2222201 0.8112318 -2.152209 -0.04307136 -0.138191 0.4572262 -0.3546211 [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] -0.2825158 0.7603675 -0.6970566 -1.313792 -0.01657433 0.7720457 -0.4141995 [2,] -0.2825158 0.7603675 -0.6970566 -1.313792 -0.01657433 0.7720457 -0.4141995 [,99] [,100] [1,] -0.5378421 1.215796 [2,] -0.5378421 1.215796 > > > Max(tmp2) [1] 2.114958 > Min(tmp2) [1] -2.039824 > mean(tmp2) [1] -0.02232557 > Sum(tmp2) [1] -2.232557 > Var(tmp2) [1] 0.9052129 > > rowMeans(tmp2) [1] 1.14439346 -0.34753124 -0.86926550 2.01934345 -1.17772333 0.58938197 [7] 0.29836136 -0.35567163 -0.18672678 0.84134308 -0.06120163 0.01360234 [13] -0.74304366 -1.07274155 -0.86223592 0.13131575 -0.35921428 -0.82139528 [19] 0.68092380 -0.19601762 0.55621064 -1.44697488 -1.14558076 0.39385224 [25] -1.52380086 1.45127688 -0.83975044 1.11915147 -0.71380000 -0.71511298 [31] -0.18997482 0.06734930 0.30182404 -0.25940193 -1.95286580 0.59731147 [37] -1.28152569 1.37863067 -1.03120830 -0.88393239 -0.28721123 -1.62435091 [43] 0.19268490 -0.54861173 -0.77019619 -0.79739307 1.34662457 -1.77522825 [49] 1.57218050 -0.13315745 0.44513521 0.51143091 -1.15255879 0.22004849 [55] 0.78230177 0.14559260 0.29967226 -0.16574055 -0.39313722 1.65293005 [61] 1.62920148 -0.94656995 -0.52544411 1.77592363 0.99640685 -0.49476805 [67] 0.71143224 -0.58489044 -0.64753807 -1.58305918 0.98862690 -0.70019459 [73] 0.72958193 -0.70525016 1.40636904 0.30389336 0.88191961 1.02014290 [79] -0.85136561 0.26560411 0.05348229 -0.50380859 0.05583270 0.08677778 [85] 1.49309401 -0.26477366 -1.29168288 -0.80050091 -0.28150006 0.10238143 [91] 0.82911051 -0.23596264 1.42495783 0.49386692 0.20357013 -1.11862461 [97] 2.11495771 -2.03982418 0.58455254 1.12292395 > rowSums(tmp2) [1] 1.14439346 -0.34753124 -0.86926550 2.01934345 -1.17772333 0.58938197 [7] 0.29836136 -0.35567163 -0.18672678 0.84134308 -0.06120163 0.01360234 [13] -0.74304366 -1.07274155 -0.86223592 0.13131575 -0.35921428 -0.82139528 [19] 0.68092380 -0.19601762 0.55621064 -1.44697488 -1.14558076 0.39385224 [25] -1.52380086 1.45127688 -0.83975044 1.11915147 -0.71380000 -0.71511298 [31] -0.18997482 0.06734930 0.30182404 -0.25940193 -1.95286580 0.59731147 [37] -1.28152569 1.37863067 -1.03120830 -0.88393239 -0.28721123 -1.62435091 [43] 0.19268490 -0.54861173 -0.77019619 -0.79739307 1.34662457 -1.77522825 [49] 1.57218050 -0.13315745 0.44513521 0.51143091 -1.15255879 0.22004849 [55] 0.78230177 0.14559260 0.29967226 -0.16574055 -0.39313722 1.65293005 [61] 1.62920148 -0.94656995 -0.52544411 1.77592363 0.99640685 -0.49476805 [67] 0.71143224 -0.58489044 -0.64753807 -1.58305918 0.98862690 -0.70019459 [73] 0.72958193 -0.70525016 1.40636904 0.30389336 0.88191961 1.02014290 [79] -0.85136561 0.26560411 0.05348229 -0.50380859 0.05583270 0.08677778 [85] 1.49309401 -0.26477366 -1.29168288 -0.80050091 -0.28150006 0.10238143 [91] 0.82911051 -0.23596264 1.42495783 0.49386692 0.20357013 -1.11862461 [97] 2.11495771 -2.03982418 0.58455254 1.12292395 > 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] 1.14439346 -0.34753124 -0.86926550 2.01934345 -1.17772333 0.58938197 [7] 0.29836136 -0.35567163 -0.18672678 0.84134308 -0.06120163 0.01360234 [13] -0.74304366 -1.07274155 -0.86223592 0.13131575 -0.35921428 -0.82139528 [19] 0.68092380 -0.19601762 0.55621064 -1.44697488 -1.14558076 0.39385224 [25] -1.52380086 1.45127688 -0.83975044 1.11915147 -0.71380000 -0.71511298 [31] -0.18997482 0.06734930 0.30182404 -0.25940193 -1.95286580 0.59731147 [37] -1.28152569 1.37863067 -1.03120830 -0.88393239 -0.28721123 -1.62435091 [43] 0.19268490 -0.54861173 -0.77019619 -0.79739307 1.34662457 -1.77522825 [49] 1.57218050 -0.13315745 0.44513521 0.51143091 -1.15255879 0.22004849 [55] 0.78230177 0.14559260 0.29967226 -0.16574055 -0.39313722 1.65293005 [61] 1.62920148 -0.94656995 -0.52544411 1.77592363 0.99640685 -0.49476805 [67] 0.71143224 -0.58489044 -0.64753807 -1.58305918 0.98862690 -0.70019459 [73] 0.72958193 -0.70525016 1.40636904 0.30389336 0.88191961 1.02014290 [79] -0.85136561 0.26560411 0.05348229 -0.50380859 0.05583270 0.08677778 [85] 1.49309401 -0.26477366 -1.29168288 -0.80050091 -0.28150006 0.10238143 [91] 0.82911051 -0.23596264 1.42495783 0.49386692 0.20357013 -1.11862461 [97] 2.11495771 -2.03982418 0.58455254 1.12292395 > rowMin(tmp2) [1] 1.14439346 -0.34753124 -0.86926550 2.01934345 -1.17772333 0.58938197 [7] 0.29836136 -0.35567163 -0.18672678 0.84134308 -0.06120163 0.01360234 [13] -0.74304366 -1.07274155 -0.86223592 0.13131575 -0.35921428 -0.82139528 [19] 0.68092380 -0.19601762 0.55621064 -1.44697488 -1.14558076 0.39385224 [25] -1.52380086 1.45127688 -0.83975044 1.11915147 -0.71380000 -0.71511298 [31] -0.18997482 0.06734930 0.30182404 -0.25940193 -1.95286580 0.59731147 [37] -1.28152569 1.37863067 -1.03120830 -0.88393239 -0.28721123 -1.62435091 [43] 0.19268490 -0.54861173 -0.77019619 -0.79739307 1.34662457 -1.77522825 [49] 1.57218050 -0.13315745 0.44513521 0.51143091 -1.15255879 0.22004849 [55] 0.78230177 0.14559260 0.29967226 -0.16574055 -0.39313722 1.65293005 [61] 1.62920148 -0.94656995 -0.52544411 1.77592363 0.99640685 -0.49476805 [67] 0.71143224 -0.58489044 -0.64753807 -1.58305918 0.98862690 -0.70019459 [73] 0.72958193 -0.70525016 1.40636904 0.30389336 0.88191961 1.02014290 [79] -0.85136561 0.26560411 0.05348229 -0.50380859 0.05583270 0.08677778 [85] 1.49309401 -0.26477366 -1.29168288 -0.80050091 -0.28150006 0.10238143 [91] 0.82911051 -0.23596264 1.42495783 0.49386692 0.20357013 -1.11862461 [97] 2.11495771 -2.03982418 0.58455254 1.12292395 > > colMeans(tmp2) [1] -0.02232557 > colSums(tmp2) [1] -2.232557 > colVars(tmp2) [1] 0.9052129 > colSd(tmp2) [1] 0.9514268 > colMax(tmp2) [1] 2.114958 > colMin(tmp2) [1] -2.039824 > colMedians(tmp2) [1] -0.09717954 > colRanges(tmp2) [,1] [1,] -2.039824 [2,] 2.114958 > > 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] -7.63119406 4.21109057 -0.34191244 0.09715365 -0.21675930 1.31269101 [7] 0.62149341 1.24523866 -1.29765149 -2.05334409 > colApply(tmp,quantile)[,1] [,1] [1,] -2.40714280 [2,] -1.77875154 [3,] -0.21566031 [4,] 0.03941054 [5,] 0.76726329 > > rowApply(tmp,sum) [1] 6.86298816 0.08332564 -0.54224047 -0.54800912 -2.78160704 -6.06104550 [7] -0.22886006 2.15661463 0.96795315 -3.96231344 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 2 1 4 2 9 2 6 5 5 1 [2,] 9 10 9 1 4 7 9 3 7 10 [3,] 1 9 7 10 7 1 7 7 6 2 [4,] 6 5 2 4 6 10 10 9 3 4 [5,] 7 6 8 5 3 6 3 4 10 5 [6,] 10 2 3 8 5 4 5 8 9 6 [7,] 8 7 6 3 1 9 1 10 8 3 [8,] 5 4 5 6 8 3 8 6 1 8 [9,] 3 8 10 9 2 5 2 2 2 7 [10,] 4 3 1 7 10 8 4 1 4 9 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 1.7407507 1.4645694 2.1114584 -2.0746104 -2.6442849 1.4205629 [7] 0.7492806 -0.7426170 -2.2684323 0.4888554 -1.2378954 0.8632343 [13] 4.5684826 -3.9265738 1.6360366 -2.4725270 2.4331982 2.2024203 [19] 2.1030942 -4.3449344 > colApply(tmp,quantile)[,1] [,1] [1,] -1.5610753 [2,] 0.3453347 [3,] 0.8127597 [4,] 0.8900229 [5,] 1.2537086 > > rowApply(tmp,sum) [1] 7.2886280 -0.5227451 0.5685844 -12.9716352 7.7072362 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 16 14 18 5 13 [2,] 18 7 10 10 15 [3,] 7 17 19 14 9 [4,] 12 16 1 6 11 [5,] 11 9 8 2 4 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.2537086 1.4824234 -0.19204430 0.6163292 0.58800624 -0.6961183 [2,] 0.3453347 -0.6075784 0.84495776 0.5813009 -0.02282795 -1.2676186 [3,] 0.8127597 -0.1198927 1.08422566 -2.2927843 -0.24047320 1.7932156 [4,] -1.5610753 -0.5725605 -0.03164607 -1.5379043 -2.30529992 0.2699174 [5,] 0.8900229 1.2821777 0.40596534 0.5584481 -0.66369004 1.3211668 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.2061286 0.2157689 -0.2995293 1.48714916 0.1412365 0.6500945 [2,] 1.5097602 -0.1017671 -1.8560461 0.18637045 -0.7606780 1.1649870 [3,] -0.9561862 0.4076140 -0.3297913 0.08298216 -0.1682425 -0.2926557 [4,] 0.1739136 0.2703396 -0.5642755 -1.05182995 -0.9340411 0.2936871 [5,] -0.1843356 -1.5345725 0.7812098 -0.21581637 0.4838297 -0.9528787 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 0.7611528 -0.93447177 1.4591279 -1.2503731073 0.7520012 -0.2248589 [2,] 0.4502977 -0.01008679 0.1267316 0.0006034284 1.7430710 -1.0400147 [3,] 0.5193230 -0.94979893 0.6198000 0.4272394264 -0.3937003 0.5822326 [4,] 0.9795714 -0.03579139 -1.6715043 -1.7582628928 -1.2658448 1.3868553 [5,] 1.8581378 -1.99642487 1.1018814 0.1082661480 1.5976711 1.4982060 [,19] [,20] [1,] 1.5197027 -0.246806093 [2,] -0.6793458 -1.130196387 [3,] 0.2625488 -0.279831421 [4,] -0.3649308 -2.690952835 [5,] 1.3651194 0.002852296 > > > 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.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 655 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 567 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-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 row1 -0.2971448 0.7927339 0.6220227 0.04573352 -0.5206411 -0.03973746 col7 col8 col9 col10 col11 col12 col13 row1 -0.1475596 -0.607878 -0.5025449 -0.6092001 0.7527261 0.3581084 -0.7293213 col14 col15 col16 col17 col18 col19 col20 row1 -1.065541 0.5199002 -0.2764144 1.711329 -1.067741 -0.1727069 -1.122852 > tmp[,"col10"] col10 row1 -0.6092001487 row2 0.0803354268 row3 -0.1291447516 row4 -0.6114077703 row5 -0.0002227203 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 -0.2971448 0.7927339 0.6220227 0.04573352 -0.5206411 -0.03973746 row5 -0.2342331 0.4080078 -0.4423024 -0.37043678 1.0265083 0.47672506 col7 col8 col9 col10 col11 col12 row1 -0.1475596 -0.607878 -0.5025449 -0.6092001487 0.7527261 0.3581084 row5 0.2364145 3.492252 -0.4939801 -0.0002227203 -0.4052939 0.3128912 col13 col14 col15 col16 col17 col18 row1 -0.7293213 -1.0655415 0.5199002 -0.2764144 1.71132879 -1.0677414 row5 1.5869615 -0.9929636 0.3263905 -0.3989561 -0.02742356 0.8801372 col19 col20 row1 -0.1727069 -1.1228518 row5 -0.5407226 0.5036982 > tmp[,c("col6","col20")] col6 col20 row1 -0.03973746 -1.1228518 row2 0.80851533 0.2559621 row3 1.08613419 -0.5028642 row4 -2.56829631 -0.9362879 row5 0.47672506 0.5036982 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 -0.03973746 -1.1228518 row5 0.47672506 0.5036982 > > > > > 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 48.22544 51.05263 49.271 51.12127 50.13727 104.9184 50.67067 50.49794 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.11387 48.6928 51.01463 49.67394 50.42175 48.01325 50.29155 49.08366 col17 col18 col19 col20 row1 49.15234 51.81003 50.56721 104.6142 > tmp[,"col10"] col10 row1 48.69280 row2 32.74312 row3 29.59189 row4 31.28329 row5 49.76748 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 48.22544 51.05263 49.27100 51.12127 50.13727 104.9184 50.67067 50.49794 row5 50.80263 50.44548 49.87798 48.94858 50.89861 102.0951 50.14901 49.55088 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.11387 48.69280 51.01463 49.67394 50.42175 48.01325 50.29155 49.08366 row5 49.13078 49.76748 50.39046 49.84496 47.91438 49.24207 49.11151 49.72239 col17 col18 col19 col20 row1 49.15234 51.81003 50.56721 104.6142 row5 49.96990 49.43422 50.35190 107.3084 > tmp[,c("col6","col20")] col6 col20 row1 104.91842 104.61417 row2 75.33720 74.41370 row3 74.30298 74.45137 row4 75.02873 74.55471 row5 102.09506 107.30845 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 104.9184 104.6142 row5 102.0951 107.3084 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 104.9184 104.6142 row5 102.0951 107.3084 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] 0.40734100 [2,] -0.02009686 [3,] -1.14644223 [4,] 1.82912692 [5,] 2.27315334 > tmp[,c("col17","col7")] col17 col7 [1,] -1.6522358 0.1233001 [2,] 0.6749134 0.2108796 [3,] 0.7127271 0.3417093 [4,] 0.9077749 1.5234247 [5,] 0.4023326 1.2043740 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -1.4163337 0.9797859 [2,] 0.2399109 0.7809660 [3,] 0.2357581 -0.0674569 [4,] 0.3202197 -0.3092259 [5,] 0.7766583 1.3873005 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -1.416334 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -1.4163337 [2,] 0.2399109 > > > > 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] row3 0.0233985 -0.2090971 1.1509014 -0.1626919 0.9447507 0.03343253 row1 2.0945886 -0.3055133 0.0903637 -0.8436806 -1.5603865 -0.26286936 [,7] [,8] [,9] [,10] [,11] [,12] [,13] row3 -1.06714662 0.5708229 1.77421123 1.7696162 0.6255232 0.9298999 0.1804827 row1 0.02789609 -1.6535688 -0.07817349 0.3000507 0.1940926 0.3352339 2.0510986 [,14] [,15] [,16] [,17] [,18] [,19] row3 -0.0006782262 0.4165375 -0.6389131 0.3548056 0.1204956 0.2007152 row1 -0.4313353427 0.2405868 -0.1621080 0.5802517 0.8129023 -0.2364144 [,20] row3 0.7905958 row1 -0.2271709 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.7078256 0.6345224 1.200821 1.256706 0.6853212 1.382032 -0.4245774 [,8] [,9] [,10] row2 -2.248356 -0.09015774 -0.1073 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -0.3391425 -2.168009 -1.41068 0.7586158 1.078896 -0.6588832 1.673256 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -2.37238 -2.082922 -0.08722129 0.8337607 2.273533 0.04516565 -0.04622658 [,15] [,16] [,17] [,18] [,19] [,20] row5 0.5300953 1.815975 -0.6615014 0.4095333 2.007366 0.3916987 > > > 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: 0x6000010f8000> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d687d47" [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d4bf8c086" [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d3827c461" [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d3acdd914" [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d2066ce35" [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d3d6c0a31" [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d113678" [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d6a0f0050" [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d7eddba95" [10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679df04cd45" [11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d44074b7" [12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d23ae9c8f" [13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d1ca88296" [14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d7b15548c" [15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM1679d3561f275" > > > ### 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: 0x60000108c1e0> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x60000108c1e0> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x60000108c1e0> > rowMedians(tmp) [1] -0.0752087395 -0.2431237131 0.2575398350 -0.3260941127 0.2366584900 [6] 0.6010412204 -0.6046313806 0.1567276757 0.0345951178 -0.1166277621 [11] 0.3107999572 0.2205032177 -0.3754001044 -0.3387629512 0.0844193658 [16] 0.5727233522 -0.0261164183 -0.3243365705 0.3201823565 -0.1820443603 [21] -0.7067610593 0.2467935547 -0.6209879453 -0.0478070154 -0.4056187478 [26] 0.1919693193 0.1731290661 -0.1082970709 0.3634445093 -0.1630425409 [31] 0.1307582064 -0.0170993496 0.2716593322 -0.2532971255 -0.2928986553 [36] 0.3495422404 -0.6623976693 -0.2050510690 0.3253263275 -0.2851636051 [41] 0.7206440205 0.2004540714 -0.3277296346 0.1424020257 -0.5216464266 [46] -0.2713286823 -0.1112276427 -0.1720302284 0.1028046147 0.5337243366 [51] 0.1607285279 -0.3917132354 0.0573866363 0.0089011910 0.0101475697 [56] 0.3646538340 0.0106401899 0.1268590250 0.6095570984 0.1657266743 [61] -0.2789738149 -0.1610646933 0.3073100561 0.6099221169 0.3747725691 [66] -0.5393820040 0.6331804382 -0.0855631781 0.1172795883 0.4231066742 [71] -0.1439889160 -0.3804358222 0.0623014548 0.1631483797 -0.0754873654 [76] -0.5358838650 0.3599573999 -0.0394288684 -0.1369681860 0.1819051484 [81] 0.3956443748 0.1408378860 -0.2358218173 0.2068075852 0.0377510431 [86] 0.1277122382 -0.3055144955 -0.1082271779 -0.5278224265 -0.1013123592 [91] -0.4013807219 -0.4390805754 0.0358933824 0.2546593002 0.1805877265 [96] 0.3030664679 0.1528635907 0.1065873379 0.0448773718 0.5333731760 [101] -0.3912737322 -0.1042882690 -0.1898082858 0.5045224488 0.6792428795 [106] 0.1036597000 0.2058474313 0.2485685643 0.2515609208 0.3277481260 [111] 0.1959669239 0.4392280550 0.0035544173 0.3972821845 0.0978288188 [116] -0.5794749955 -0.2666170693 -0.1819208302 0.2125590828 0.3198798536 [121] -0.0026246242 0.0251055237 -0.3825778176 -0.3457083168 0.4691083756 [126] 0.4606911981 -0.1103543145 -0.1115840940 0.1552748148 -0.0596861192 [131] -0.2313009127 -0.2977222427 0.1671374711 0.0460383041 -0.6524728594 [136] 0.8213586018 0.2167434362 -0.0077486886 -0.2318196087 -0.2379358888 [141] 0.4913128058 0.3828811953 0.2541156457 -0.6431328725 0.4794146435 [146] -0.1366304100 -0.4878383089 -0.2179036335 0.3013581960 -0.6590026051 [151] 0.0488595877 -0.0225455836 0.2199630844 0.5446156088 -0.0046050368 [156] 0.2640918068 -0.1686972454 -0.0978323050 0.5903528826 0.1485697546 [161] -0.2831558213 -0.0730143236 -0.0449134117 0.1703846150 -0.4385129713 [166] 0.1287359629 0.2574556923 -0.4264653673 -0.0153271265 0.5175962690 [171] 0.0943904182 -0.4921150852 -0.1375074994 0.1147180272 -0.1978662341 [176] 0.2287001033 -0.0369009266 0.2026048830 -0.2417314261 -0.0800011184 [181] -0.3635286556 0.4432568682 -0.3180263882 0.2377839905 0.1211934732 [186] -0.3814225935 -0.0579615716 -0.2029915089 -0.7637992302 0.0008590416 [191] 0.3055831657 0.0510712804 0.0242558844 0.0370752478 0.0013689643 [196] -0.4319010352 0.7161008538 -0.2820793472 0.1740938898 -0.0645294821 [201] -0.2875752999 0.3270819436 -0.1643714060 -0.2401394788 0.3853228365 [206] -0.2111385808 0.3594833105 0.2808825795 0.1723034409 -0.0659924083 [211] -0.2608905312 -0.0263290762 -0.1459974073 -0.3518497218 0.0036285815 [216] 0.0161758571 0.2187205203 -0.0756664970 0.1283833325 0.1132581961 [221] -0.2560701064 -0.2097747701 0.3234315163 -0.2610968313 0.2250425197 [226] -0.4912838657 -0.1255309132 0.1581255654 0.0068620648 -0.2573831980 > > proc.time() user system elapsed 5.083 18.815 26.290
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.4.3 (2025-02-28) -- "Trophy Case" 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: 0x600001dfc3c0> > .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: 0x600001dfc3c0> > .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: 0x600001dfc3c0> > .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: 0x600001dfc3c0> > 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: 0x600001de4060> > .Call("R_bm_AddColumn",P) <pointer: 0x600001de4060> > .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: 0x600001de4060> > .Call("R_bm_AddColumn",P) <pointer: 0x600001de4060> > .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: 0x600001de4060> > 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: 0x600001dd4060> > .Call("R_bm_AddColumn",P) <pointer: 0x600001dd4060> > .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: 0x600001dd4060> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001dd4060> > .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: 0x600001dd4060> > > .Call("R_bm_RowMode",P) <pointer: 0x600001dd4060> > .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: 0x600001dd4060> > > .Call("R_bm_ColMode",P) <pointer: 0x600001dd4060> > .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: 0x600001dd4060> > 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: 0x600001da8000> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x600001da8000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001da8000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001da8000> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile16ee9124b560c" "BufferedMatrixFile16ee946537976" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile16ee9124b560c" "BufferedMatrixFile16ee946537976" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001dec000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001dec000> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001dec000> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001dec000> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x600001dec000> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x600001dec000> > .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: 0x600001dec180> > .Call("R_bm_AddColumn",P) <pointer: 0x600001dec180> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001dec180> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x600001dec180> > 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: 0x600001dec360> > .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: 0x600001dec360> > rm(P) > > proc.time() user system elapsed 0.574 0.217 0.824
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.4.3 (2025-02-28) -- "Trophy Case" 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.575 0.135 0.695