Back to Multiple platform build/check report for BioC 3.21: simplified long |
|
This page was generated on 2025-02-11 11:41 -0500 (Tue, 11 Feb 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo1 | Linux (Ubuntu 24.04.1 LTS) | x86_64 | R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" | 4719 |
palomino7 | Windows Server 2022 Datacenter | x64 | R Under development (unstable) (2025-01-21 r87610 ucrt) -- "Unsuffered Consequences" | 4480 |
lconway | macOS 12.7.1 Monterey | x86_64 | R Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" | 4491 |
kjohnson3 | macOS 13.7.1 Ventura | arm64 | R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" | 4444 |
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 247/2295 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.71.1 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.1 LTS) / x86_64 | OK | OK | OK | |||||||||
palomino7 | Windows Server 2022 Datacenter / x64 | OK | OK | OK | OK | |||||||||
lconway | macOS 12.7.1 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
kjohnson3 | macOS 13.7.1 Ventura / arm64 | OK | OK | WARNINGS | 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.71.1 |
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.71.1.tar.gz |
StartedAt: 2025-02-10 19:52:35 -0500 (Mon, 10 Feb 2025) |
EndedAt: 2025-02-10 19:53:30 -0500 (Mon, 10 Feb 2025) |
EllapsedTime: 55.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.71.1.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’ * using R Under development (unstable) (2025-01-22 r87618) * 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.71.1’ * 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.71.1’ ** 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.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 Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" 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.360 0.164 0.525
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" 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 480185 25.7 1054630 56.4 NA 634654 33.9 Vcells 889954 6.8 8388608 64.0 98304 2107350 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] "Mon Feb 10 19:53:01 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] "Mon Feb 10 19:53:01 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: 0x600002554000> > > > > 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] "Mon Feb 10 19:53:07 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] "Mon Feb 10 19:53:09 2025" > > ColMode(tmp2) <pointer: 0x600002554000> > > > > ### 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,] 100.22302483 0.5300964 -1.09585895 0.6792955 [2,] 0.20257296 -0.3128743 -0.60021351 0.1243035 [3,] -0.70959274 -0.8374526 -1.15294371 -0.4302570 [4,] -0.01587329 0.2707840 -0.06523714 -0.3834252 > 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,] 100.22302483 0.5300964 1.09585895 0.6792955 [2,] 0.20257296 0.3128743 0.60021351 0.1243035 [3,] 0.70959274 0.8374526 1.15294371 0.4302570 [4,] 0.01587329 0.2707840 0.06523714 0.3834252 > 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,] 10.0111450 0.7280772 1.0468328 0.8241938 [2,] 0.4500811 0.5593517 0.7747345 0.3525670 [3,] 0.8423733 0.9151244 1.0737522 0.6559398 [4,] 0.1259892 0.5203691 0.2554156 0.6192134 > > 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,] 225.33448 32.81087 36.56419 33.92123 [2,] 29.70338 30.90639 33.34756 28.64997 [3,] 34.13333 34.98870 36.89047 31.98965 [4,] 26.27577 30.47448 27.61939 31.57556 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x600002514000> > exp(tmp5) <pointer: 0x600002514000> > log(tmp5,2) <pointer: 0x600002514000> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 469.0042 > Min(tmp5) [1] 53.58256 > mean(tmp5) [1] 71.78532 > Sum(tmp5) [1] 14357.06 > Var(tmp5) [1] 870.4752 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 90.38001 67.44199 70.94559 65.64422 67.71573 72.40792 72.04479 71.61637 [9] 71.94942 67.70718 > rowSums(tmp5) [1] 1807.600 1348.840 1418.912 1312.884 1354.315 1448.158 1440.896 1432.327 [9] 1438.988 1354.144 > rowVars(tmp5) [1] 8026.47217 69.05411 81.81255 58.02901 52.86933 63.31791 [7] 79.86453 103.90249 81.17821 40.84672 > rowSd(tmp5) [1] 89.590581 8.309880 9.045029 7.617677 7.271130 7.957255 8.936696 [8] 10.193257 9.009895 6.391144 > rowMax(tmp5) [1] 469.00419 91.56755 90.18868 86.25399 83.00599 88.02992 87.57521 [8] 86.47306 87.54082 78.28109 > rowMin(tmp5) [1] 53.58256 56.28356 54.89045 54.68956 55.52044 57.43597 60.75196 56.46761 [9] 55.13279 57.33072 > > colMeans(tmp5) [1] 109.02686 71.98862 72.62841 70.21121 73.55118 68.80199 66.77958 [8] 71.76188 66.72629 68.68970 70.42954 73.72690 67.83475 73.43723 [15] 68.27781 67.57994 67.42950 69.18421 68.12009 69.52075 > colSums(tmp5) [1] 1090.2686 719.8862 726.2841 702.1121 735.5118 688.0199 667.7958 [8] 717.6188 667.2629 686.8970 704.2954 737.2690 678.3475 734.3723 [15] 682.7781 675.7994 674.2950 691.8421 681.2009 695.2075 > colVars(tmp5) [1] 16089.81182 65.51126 87.76428 71.55642 56.33717 52.59834 [7] 58.33841 88.39261 75.07487 61.63444 28.34689 182.38593 [13] 91.21799 132.68639 69.17690 31.29776 52.47865 107.53396 [19] 64.39180 46.58403 > colSd(tmp5) [1] 126.845622 8.093903 9.368259 8.459103 7.505809 7.252471 [7] 7.637958 9.401734 8.664575 7.850761 5.324180 13.505034 [13] 9.550811 11.518958 8.317265 5.594440 7.244215 10.369858 [19] 8.024450 6.825249 > colMax(tmp5) [1] 469.00419 84.58261 88.02992 84.40458 87.11014 80.49182 82.25472 [8] 83.23031 85.19812 79.75063 78.44796 96.32426 84.06781 91.56755 [15] 78.06292 76.98744 80.60108 86.16211 86.47306 80.78972 > colMin(tmp5) [1] 54.68956 63.42863 57.48615 58.11653 63.03979 58.73847 57.33072 58.85495 [9] 54.89045 56.46761 63.58395 59.38862 55.52044 53.58256 56.28356 57.96196 [17] 58.13541 55.13279 58.69722 58.34079 > > > ### 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.38001 67.44199 70.94559 65.64422 67.71573 NA 72.04479 71.61637 [9] 71.94942 67.70718 > rowSums(tmp5) [1] 1807.600 1348.840 1418.912 1312.884 1354.315 NA 1440.896 1432.327 [9] 1438.988 1354.144 > rowVars(tmp5) [1] 8026.47217 69.05411 81.81255 58.02901 52.86933 65.25427 [7] 79.86453 103.90249 81.17821 40.84672 > rowSd(tmp5) [1] 89.590581 8.309880 9.045029 7.617677 7.271130 8.078011 8.936696 [8] 10.193257 9.009895 6.391144 > rowMax(tmp5) [1] 469.00419 91.56755 90.18868 86.25399 83.00599 NA 87.57521 [8] 86.47306 87.54082 78.28109 > rowMin(tmp5) [1] 53.58256 56.28356 54.89045 54.68956 55.52044 NA 60.75196 56.46761 [9] 55.13279 57.33072 > > colMeans(tmp5) [1] 109.02686 71.98862 72.62841 70.21121 73.55118 68.80199 66.77958 [8] 71.76188 66.72629 68.68970 70.42954 NA 67.83475 73.43723 [15] 68.27781 67.57994 67.42950 69.18421 68.12009 69.52075 > colSums(tmp5) [1] 1090.2686 719.8862 726.2841 702.1121 735.5118 688.0199 667.7958 [8] 717.6188 667.2629 686.8970 704.2954 NA 678.3475 734.3723 [15] 682.7781 675.7994 674.2950 691.8421 681.2009 695.2075 > colVars(tmp5) [1] 16089.81182 65.51126 87.76428 71.55642 56.33717 52.59834 [7] 58.33841 88.39261 75.07487 61.63444 28.34689 NA [13] 91.21799 132.68639 69.17690 31.29776 52.47865 107.53396 [19] 64.39180 46.58403 > colSd(tmp5) [1] 126.845622 8.093903 9.368259 8.459103 7.505809 7.252471 [7] 7.637958 9.401734 8.664575 7.850761 5.324180 NA [13] 9.550811 11.518958 8.317265 5.594440 7.244215 10.369858 [19] 8.024450 6.825249 > colMax(tmp5) [1] 469.00419 84.58261 88.02992 84.40458 87.11014 80.49182 82.25472 [8] 83.23031 85.19812 79.75063 78.44796 NA 84.06781 91.56755 [15] 78.06292 76.98744 80.60108 86.16211 86.47306 80.78972 > colMin(tmp5) [1] 54.68956 63.42863 57.48615 58.11653 63.03979 58.73847 57.33072 58.85495 [9] 54.89045 56.46761 63.58395 NA 55.52044 53.58256 56.28356 57.96196 [17] 58.13541 55.13279 58.69722 58.34079 > > Max(tmp5,na.rm=TRUE) [1] 469.0042 > Min(tmp5,na.rm=TRUE) [1] 53.58256 > mean(tmp5,na.rm=TRUE) [1] 71.75606 > Sum(tmp5,na.rm=TRUE) [1] 14279.46 > Var(tmp5,na.rm=TRUE) [1] 874.6994 > > rowMeans(tmp5,na.rm=TRUE) [1] 90.38001 67.44199 70.94559 65.64422 67.71573 72.13423 72.04479 71.61637 [9] 71.94942 67.70718 > rowSums(tmp5,na.rm=TRUE) [1] 1807.600 1348.840 1418.912 1312.884 1354.315 1370.550 1440.896 1432.327 [9] 1438.988 1354.144 > rowVars(tmp5,na.rm=TRUE) [1] 8026.47217 69.05411 81.81255 58.02901 52.86933 65.25427 [7] 79.86453 103.90249 81.17821 40.84672 > rowSd(tmp5,na.rm=TRUE) [1] 89.590581 8.309880 9.045029 7.617677 7.271130 8.078011 8.936696 [8] 10.193257 9.009895 6.391144 > rowMax(tmp5,na.rm=TRUE) [1] 469.00419 91.56755 90.18868 86.25399 83.00599 88.02992 87.57521 [8] 86.47306 87.54082 78.28109 > rowMin(tmp5,na.rm=TRUE) [1] 53.58256 56.28356 54.89045 54.68956 55.52044 57.43597 60.75196 56.46761 [9] 55.13279 57.33072 > > colMeans(tmp5,na.rm=TRUE) [1] 109.02686 71.98862 72.62841 70.21121 73.55118 68.80199 66.77958 [8] 71.76188 66.72629 68.68970 70.42954 73.29568 67.83475 73.43723 [15] 68.27781 67.57994 67.42950 69.18421 68.12009 69.52075 > colSums(tmp5,na.rm=TRUE) [1] 1090.2686 719.8862 726.2841 702.1121 735.5118 688.0199 667.7958 [8] 717.6188 667.2629 686.8970 704.2954 659.6611 678.3475 734.3723 [15] 682.7781 675.7994 674.2950 691.8421 681.2009 695.2075 > colVars(tmp5,na.rm=TRUE) [1] 16089.81182 65.51126 87.76428 71.55642 56.33717 52.59834 [7] 58.33841 88.39261 75.07487 61.63444 28.34689 203.09215 [13] 91.21799 132.68639 69.17690 31.29776 52.47865 107.53396 [19] 64.39180 46.58403 > colSd(tmp5,na.rm=TRUE) [1] 126.845622 8.093903 9.368259 8.459103 7.505809 7.252471 [7] 7.637958 9.401734 8.664575 7.850761 5.324180 14.251040 [13] 9.550811 11.518958 8.317265 5.594440 7.244215 10.369858 [19] 8.024450 6.825249 > colMax(tmp5,na.rm=TRUE) [1] 469.00419 84.58261 88.02992 84.40458 87.11014 80.49182 82.25472 [8] 83.23031 85.19812 79.75063 78.44796 96.32426 84.06781 91.56755 [15] 78.06292 76.98744 80.60108 86.16211 86.47306 80.78972 > colMin(tmp5,na.rm=TRUE) [1] 54.68956 63.42863 57.48615 58.11653 63.03979 58.73847 57.33072 58.85495 [9] 54.89045 56.46761 63.58395 59.38862 55.52044 53.58256 56.28356 57.96196 [17] 58.13541 55.13279 58.69722 58.34079 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 90.38001 67.44199 70.94559 65.64422 67.71573 NaN 72.04479 71.61637 [9] 71.94942 67.70718 > rowSums(tmp5,na.rm=TRUE) [1] 1807.600 1348.840 1418.912 1312.884 1354.315 0.000 1440.896 1432.327 [9] 1438.988 1354.144 > rowVars(tmp5,na.rm=TRUE) [1] 8026.47217 69.05411 81.81255 58.02901 52.86933 NA [7] 79.86453 103.90249 81.17821 40.84672 > rowSd(tmp5,na.rm=TRUE) [1] 89.590581 8.309880 9.045029 7.617677 7.271130 NA 8.936696 [8] 10.193257 9.009895 6.391144 > rowMax(tmp5,na.rm=TRUE) [1] 469.00419 91.56755 90.18868 86.25399 83.00599 NA 87.57521 [8] 86.47306 87.54082 78.28109 > rowMin(tmp5,na.rm=TRUE) [1] 53.58256 56.28356 54.89045 54.68956 55.52044 NA 60.75196 56.46761 [9] 55.13279 57.33072 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 112.78979 72.85067 70.91714 70.13103 73.55634 68.16215 67.51061 [8] 71.27522 66.38928 67.46070 69.74844 NaN 68.07627 73.35523 [15] 69.48246 67.31832 65.96599 68.60187 69.16708 68.26864 > colSums(tmp5,na.rm=TRUE) [1] 1015.1081 655.6560 638.2542 631.1793 662.0071 613.4594 607.5955 [8] 641.4770 597.5035 607.1463 627.7359 0.0000 612.6864 660.1971 [15] 625.3422 605.8648 593.6939 617.4168 622.5037 614.4178 > colVars(tmp5,na.rm=TRUE) [1] 17941.74256 65.34001 65.78950 80.42866 63.37901 54.56750 [7] 59.61860 96.77723 83.18145 52.34648 26.67141 NA [13] 101.96403 149.19656 61.49824 34.43994 34.94257 117.16053 [19] 60.10875 34.76958 > colSd(tmp5,na.rm=TRUE) [1] 133.946790 8.083317 8.111072 8.968203 7.961094 7.386982 [7] 7.721308 9.837542 9.120387 7.235087 5.164437 NA [13] 10.097724 12.214604 7.842082 5.868555 5.911224 10.824072 [19] 7.752983 5.896573 > colMax(tmp5,na.rm=TRUE) [1] 469.00419 84.58261 83.00599 84.40458 87.11014 80.49182 82.25472 [8] 83.23031 85.19812 78.97499 78.44796 -Inf 84.06781 91.56755 [15] 78.06292 76.98744 76.41016 86.16211 86.47306 77.43428 > colMin(tmp5,na.rm=TRUE) [1] 54.68956 63.42863 57.48615 58.11653 63.03979 58.73847 57.33072 58.85495 [9] 54.89045 56.46761 63.58395 Inf 55.52044 53.58256 56.28356 57.96196 [17] 58.13541 55.13279 62.50786 58.34079 > > > > > 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] 167.3641 222.7800 169.8441 281.7774 263.2200 186.8784 302.2981 196.7738 [9] 146.1042 242.7642 > apply(copymatrix,1,var,na.rm=TRUE) [1] 167.3641 222.7800 169.8441 281.7774 263.2200 186.8784 302.2981 196.7738 [9] 146.1042 242.7642 > > > > 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] 1.136868e-13 1.421085e-13 2.842171e-14 1.705303e-13 5.684342e-14 [6] 0.000000e+00 0.000000e+00 3.410605e-13 -1.136868e-13 2.273737e-13 [11] 2.842171e-14 1.136868e-13 0.000000e+00 -4.263256e-14 -4.263256e-14 [16] 2.842171e-14 -5.684342e-14 -2.273737e-13 9.947598e-14 2.842171e-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) + } 5 16 1 4 1 9 6 11 6 7 8 19 3 13 10 7 6 6 2 17 4 1 3 14 7 20 10 17 5 6 5 20 7 11 5 7 6 1 4 15 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] 2.74205 > Min(tmp) [1] -3.184435 > mean(tmp) [1] -0.1882611 > Sum(tmp) [1] -18.82611 > Var(tmp) [1] 1.139933 > > rowMeans(tmp) [1] -0.1882611 > rowSums(tmp) [1] -18.82611 > rowVars(tmp) [1] 1.139933 > rowSd(tmp) [1] 1.067676 > rowMax(tmp) [1] 2.74205 > rowMin(tmp) [1] -3.184435 > > colMeans(tmp) [1] 1.01820306 -1.73959510 -0.63709055 1.99427360 -0.71331678 1.95857369 [7] -0.27775787 -0.56228100 0.15431768 -0.43447382 -0.95784297 2.26869415 [13] 0.25544833 0.46489198 0.24338222 0.14807153 -1.67603094 -0.10998807 [19] -1.96471020 0.37808565 0.06754002 -0.57465015 -0.81937699 0.28432558 [25] -1.16013533 0.62641358 0.95440213 -2.09946826 -0.85576682 -0.62495894 [31] 0.32169176 -0.67642598 0.90364797 -0.37290235 -3.18443466 -1.48267146 [37] -1.45724995 -0.38127013 0.89112333 0.98992924 -0.67402228 -0.17112267 [43] -1.58718440 0.93262564 -1.42750574 -0.77852231 -0.07629989 1.28465844 [49] 1.04478759 -1.49045305 -0.97259442 -1.09047811 1.64078703 -0.45921150 [55] 0.68309469 -0.98925705 -0.93257900 1.37307396 -0.03345045 -1.06911038 [61] -0.16592242 0.73169730 -0.54769093 0.77038357 0.09852047 -0.74142604 [67] 0.27410161 0.60918857 0.11449350 0.62351510 -0.60728601 -0.19678295 [73] -0.50865702 2.74205038 1.12846480 0.60960081 -0.24489386 0.05757543 [79] 0.74096366 1.43017946 -1.14124846 -0.19724534 -0.36757375 0.70531012 [85] -0.42695335 -0.92501935 -0.75281422 -0.91978275 -0.22160755 -0.47615296 [91] 0.99062544 -2.25658101 0.63870514 -1.03302359 -2.31346896 -0.03811080 [97] -2.17799085 0.73129986 -1.52198648 -0.40842140 > colSums(tmp) [1] 1.01820306 -1.73959510 -0.63709055 1.99427360 -0.71331678 1.95857369 [7] -0.27775787 -0.56228100 0.15431768 -0.43447382 -0.95784297 2.26869415 [13] 0.25544833 0.46489198 0.24338222 0.14807153 -1.67603094 -0.10998807 [19] -1.96471020 0.37808565 0.06754002 -0.57465015 -0.81937699 0.28432558 [25] -1.16013533 0.62641358 0.95440213 -2.09946826 -0.85576682 -0.62495894 [31] 0.32169176 -0.67642598 0.90364797 -0.37290235 -3.18443466 -1.48267146 [37] -1.45724995 -0.38127013 0.89112333 0.98992924 -0.67402228 -0.17112267 [43] -1.58718440 0.93262564 -1.42750574 -0.77852231 -0.07629989 1.28465844 [49] 1.04478759 -1.49045305 -0.97259442 -1.09047811 1.64078703 -0.45921150 [55] 0.68309469 -0.98925705 -0.93257900 1.37307396 -0.03345045 -1.06911038 [61] -0.16592242 0.73169730 -0.54769093 0.77038357 0.09852047 -0.74142604 [67] 0.27410161 0.60918857 0.11449350 0.62351510 -0.60728601 -0.19678295 [73] -0.50865702 2.74205038 1.12846480 0.60960081 -0.24489386 0.05757543 [79] 0.74096366 1.43017946 -1.14124846 -0.19724534 -0.36757375 0.70531012 [85] -0.42695335 -0.92501935 -0.75281422 -0.91978275 -0.22160755 -0.47615296 [91] 0.99062544 -2.25658101 0.63870514 -1.03302359 -2.31346896 -0.03811080 [97] -2.17799085 0.73129986 -1.52198648 -0.40842140 > 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] 1.01820306 -1.73959510 -0.63709055 1.99427360 -0.71331678 1.95857369 [7] -0.27775787 -0.56228100 0.15431768 -0.43447382 -0.95784297 2.26869415 [13] 0.25544833 0.46489198 0.24338222 0.14807153 -1.67603094 -0.10998807 [19] -1.96471020 0.37808565 0.06754002 -0.57465015 -0.81937699 0.28432558 [25] -1.16013533 0.62641358 0.95440213 -2.09946826 -0.85576682 -0.62495894 [31] 0.32169176 -0.67642598 0.90364797 -0.37290235 -3.18443466 -1.48267146 [37] -1.45724995 -0.38127013 0.89112333 0.98992924 -0.67402228 -0.17112267 [43] -1.58718440 0.93262564 -1.42750574 -0.77852231 -0.07629989 1.28465844 [49] 1.04478759 -1.49045305 -0.97259442 -1.09047811 1.64078703 -0.45921150 [55] 0.68309469 -0.98925705 -0.93257900 1.37307396 -0.03345045 -1.06911038 [61] -0.16592242 0.73169730 -0.54769093 0.77038357 0.09852047 -0.74142604 [67] 0.27410161 0.60918857 0.11449350 0.62351510 -0.60728601 -0.19678295 [73] -0.50865702 2.74205038 1.12846480 0.60960081 -0.24489386 0.05757543 [79] 0.74096366 1.43017946 -1.14124846 -0.19724534 -0.36757375 0.70531012 [85] -0.42695335 -0.92501935 -0.75281422 -0.91978275 -0.22160755 -0.47615296 [91] 0.99062544 -2.25658101 0.63870514 -1.03302359 -2.31346896 -0.03811080 [97] -2.17799085 0.73129986 -1.52198648 -0.40842140 > colMin(tmp) [1] 1.01820306 -1.73959510 -0.63709055 1.99427360 -0.71331678 1.95857369 [7] -0.27775787 -0.56228100 0.15431768 -0.43447382 -0.95784297 2.26869415 [13] 0.25544833 0.46489198 0.24338222 0.14807153 -1.67603094 -0.10998807 [19] -1.96471020 0.37808565 0.06754002 -0.57465015 -0.81937699 0.28432558 [25] -1.16013533 0.62641358 0.95440213 -2.09946826 -0.85576682 -0.62495894 [31] 0.32169176 -0.67642598 0.90364797 -0.37290235 -3.18443466 -1.48267146 [37] -1.45724995 -0.38127013 0.89112333 0.98992924 -0.67402228 -0.17112267 [43] -1.58718440 0.93262564 -1.42750574 -0.77852231 -0.07629989 1.28465844 [49] 1.04478759 -1.49045305 -0.97259442 -1.09047811 1.64078703 -0.45921150 [55] 0.68309469 -0.98925705 -0.93257900 1.37307396 -0.03345045 -1.06911038 [61] -0.16592242 0.73169730 -0.54769093 0.77038357 0.09852047 -0.74142604 [67] 0.27410161 0.60918857 0.11449350 0.62351510 -0.60728601 -0.19678295 [73] -0.50865702 2.74205038 1.12846480 0.60960081 -0.24489386 0.05757543 [79] 0.74096366 1.43017946 -1.14124846 -0.19724534 -0.36757375 0.70531012 [85] -0.42695335 -0.92501935 -0.75281422 -0.91978275 -0.22160755 -0.47615296 [91] 0.99062544 -2.25658101 0.63870514 -1.03302359 -2.31346896 -0.03811080 [97] -2.17799085 0.73129986 -1.52198648 -0.40842140 > colMedians(tmp) [1] 1.01820306 -1.73959510 -0.63709055 1.99427360 -0.71331678 1.95857369 [7] -0.27775787 -0.56228100 0.15431768 -0.43447382 -0.95784297 2.26869415 [13] 0.25544833 0.46489198 0.24338222 0.14807153 -1.67603094 -0.10998807 [19] -1.96471020 0.37808565 0.06754002 -0.57465015 -0.81937699 0.28432558 [25] -1.16013533 0.62641358 0.95440213 -2.09946826 -0.85576682 -0.62495894 [31] 0.32169176 -0.67642598 0.90364797 -0.37290235 -3.18443466 -1.48267146 [37] -1.45724995 -0.38127013 0.89112333 0.98992924 -0.67402228 -0.17112267 [43] -1.58718440 0.93262564 -1.42750574 -0.77852231 -0.07629989 1.28465844 [49] 1.04478759 -1.49045305 -0.97259442 -1.09047811 1.64078703 -0.45921150 [55] 0.68309469 -0.98925705 -0.93257900 1.37307396 -0.03345045 -1.06911038 [61] -0.16592242 0.73169730 -0.54769093 0.77038357 0.09852047 -0.74142604 [67] 0.27410161 0.60918857 0.11449350 0.62351510 -0.60728601 -0.19678295 [73] -0.50865702 2.74205038 1.12846480 0.60960081 -0.24489386 0.05757543 [79] 0.74096366 1.43017946 -1.14124846 -0.19724534 -0.36757375 0.70531012 [85] -0.42695335 -0.92501935 -0.75281422 -0.91978275 -0.22160755 -0.47615296 [91] 0.99062544 -2.25658101 0.63870514 -1.03302359 -2.31346896 -0.03811080 [97] -2.17799085 0.73129986 -1.52198648 -0.40842140 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 1.018203 -1.739595 -0.6370906 1.994274 -0.7133168 1.958574 -0.2777579 [2,] 1.018203 -1.739595 -0.6370906 1.994274 -0.7133168 1.958574 -0.2777579 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.562281 0.1543177 -0.4344738 -0.957843 2.268694 0.2554483 0.464892 [2,] -0.562281 0.1543177 -0.4344738 -0.957843 2.268694 0.2554483 0.464892 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 0.2433822 0.1480715 -1.676031 -0.1099881 -1.96471 0.3780857 0.06754002 [2,] 0.2433822 0.1480715 -1.676031 -0.1099881 -1.96471 0.3780857 0.06754002 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.5746502 -0.819377 0.2843256 -1.160135 0.6264136 0.9544021 -2.099468 [2,] -0.5746502 -0.819377 0.2843256 -1.160135 0.6264136 0.9544021 -2.099468 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.8557668 -0.6249589 0.3216918 -0.676426 0.903648 -0.3729024 -3.184435 [2,] -0.8557668 -0.6249589 0.3216918 -0.676426 0.903648 -0.3729024 -3.184435 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] -1.482671 -1.45725 -0.3812701 0.8911233 0.9899292 -0.6740223 -0.1711227 [2,] -1.482671 -1.45725 -0.3812701 0.8911233 0.9899292 -0.6740223 -0.1711227 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] -1.587184 0.9326256 -1.427506 -0.7785223 -0.07629989 1.284658 1.044788 [2,] -1.587184 0.9326256 -1.427506 -0.7785223 -0.07629989 1.284658 1.044788 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [1,] -1.490453 -0.9725944 -1.090478 1.640787 -0.4592115 0.6830947 -0.9892571 [2,] -1.490453 -0.9725944 -1.090478 1.640787 -0.4592115 0.6830947 -0.9892571 [,57] [,58] [,59] [,60] [,61] [,62] [,63] [1,] -0.932579 1.373074 -0.03345045 -1.06911 -0.1659224 0.7316973 -0.5476909 [2,] -0.932579 1.373074 -0.03345045 -1.06911 -0.1659224 0.7316973 -0.5476909 [,64] [,65] [,66] [,67] [,68] [,69] [,70] [1,] 0.7703836 0.09852047 -0.741426 0.2741016 0.6091886 0.1144935 0.6235151 [2,] 0.7703836 0.09852047 -0.741426 0.2741016 0.6091886 0.1144935 0.6235151 [,71] [,72] [,73] [,74] [,75] [,76] [,77] [1,] -0.607286 -0.196783 -0.508657 2.74205 1.128465 0.6096008 -0.2448939 [2,] -0.607286 -0.196783 -0.508657 2.74205 1.128465 0.6096008 -0.2448939 [,78] [,79] [,80] [,81] [,82] [,83] [,84] [1,] 0.05757543 0.7409637 1.430179 -1.141248 -0.1972453 -0.3675738 0.7053101 [2,] 0.05757543 0.7409637 1.430179 -1.141248 -0.1972453 -0.3675738 0.7053101 [,85] [,86] [,87] [,88] [,89] [,90] [,91] [1,] -0.4269534 -0.9250194 -0.7528142 -0.9197827 -0.2216076 -0.476153 0.9906254 [2,] -0.4269534 -0.9250194 -0.7528142 -0.9197827 -0.2216076 -0.476153 0.9906254 [,92] [,93] [,94] [,95] [,96] [,97] [,98] [1,] -2.256581 0.6387051 -1.033024 -2.313469 -0.0381108 -2.177991 0.7312999 [2,] -2.256581 0.6387051 -1.033024 -2.313469 -0.0381108 -2.177991 0.7312999 [,99] [,100] [1,] -1.521986 -0.4084214 [2,] -1.521986 -0.4084214 > > > Max(tmp2) [1] 2.567786 > Min(tmp2) [1] -2.047257 > mean(tmp2) [1] -0.1157469 > Sum(tmp2) [1] -11.57469 > Var(tmp2) [1] 0.9142491 > > rowMeans(tmp2) [1] -0.997615300 -0.475221351 0.619307253 0.209837573 0.835796912 [6] -0.376128594 -0.820359128 0.026511281 -1.429746789 -0.893470333 [11] -0.622878261 -0.450309964 1.832653692 1.191781462 -0.983687933 [16] 0.115050295 -0.884553916 1.947897926 -1.014516122 1.086185288 [21] -0.986882577 0.273998114 -1.322045921 -0.617871359 1.061904526 [26] -1.259310737 0.374443954 1.775710046 0.456071449 -0.433735979 [31] 0.031586300 -1.323923967 0.214797765 -0.534669391 0.079098228 [36] 0.065572196 0.452380048 0.001188623 -0.316185870 0.976597432 [41] -0.390966787 -0.607339619 -1.188298050 0.023769885 -1.023111173 [46] -1.381533999 -1.264121390 -1.597365038 0.054749127 1.191622591 [51] -0.516898293 -1.132177436 0.490700861 -0.312115498 2.567786085 [56] -0.571962721 -0.203106017 -0.361444802 -0.719425801 -1.163453466 [61] -0.535501333 0.027114245 1.646757232 -1.141026104 0.475684368 [66] -1.279443338 0.698925651 -2.047257259 -0.041163593 0.589773277 [71] 1.707253357 0.937907535 -0.864684329 -0.197564595 -0.364027487 [76] 0.183202595 -1.608243515 1.154745716 -0.224622248 0.133510599 [81] -0.548408326 -0.427018552 0.289101453 0.049402748 0.208533731 [86] -0.055802092 1.727144851 0.665139886 -1.706761077 -0.164372230 [91] -0.222822912 -0.531292372 -1.145159268 1.261884983 -0.202399260 [96] -1.254196233 -1.005347536 -0.747116016 1.629272619 1.573616112 > rowSums(tmp2) [1] -0.997615300 -0.475221351 0.619307253 0.209837573 0.835796912 [6] -0.376128594 -0.820359128 0.026511281 -1.429746789 -0.893470333 [11] -0.622878261 -0.450309964 1.832653692 1.191781462 -0.983687933 [16] 0.115050295 -0.884553916 1.947897926 -1.014516122 1.086185288 [21] -0.986882577 0.273998114 -1.322045921 -0.617871359 1.061904526 [26] -1.259310737 0.374443954 1.775710046 0.456071449 -0.433735979 [31] 0.031586300 -1.323923967 0.214797765 -0.534669391 0.079098228 [36] 0.065572196 0.452380048 0.001188623 -0.316185870 0.976597432 [41] -0.390966787 -0.607339619 -1.188298050 0.023769885 -1.023111173 [46] -1.381533999 -1.264121390 -1.597365038 0.054749127 1.191622591 [51] -0.516898293 -1.132177436 0.490700861 -0.312115498 2.567786085 [56] -0.571962721 -0.203106017 -0.361444802 -0.719425801 -1.163453466 [61] -0.535501333 0.027114245 1.646757232 -1.141026104 0.475684368 [66] -1.279443338 0.698925651 -2.047257259 -0.041163593 0.589773277 [71] 1.707253357 0.937907535 -0.864684329 -0.197564595 -0.364027487 [76] 0.183202595 -1.608243515 1.154745716 -0.224622248 0.133510599 [81] -0.548408326 -0.427018552 0.289101453 0.049402748 0.208533731 [86] -0.055802092 1.727144851 0.665139886 -1.706761077 -0.164372230 [91] -0.222822912 -0.531292372 -1.145159268 1.261884983 -0.202399260 [96] -1.254196233 -1.005347536 -0.747116016 1.629272619 1.573616112 > 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.997615300 -0.475221351 0.619307253 0.209837573 0.835796912 [6] -0.376128594 -0.820359128 0.026511281 -1.429746789 -0.893470333 [11] -0.622878261 -0.450309964 1.832653692 1.191781462 -0.983687933 [16] 0.115050295 -0.884553916 1.947897926 -1.014516122 1.086185288 [21] -0.986882577 0.273998114 -1.322045921 -0.617871359 1.061904526 [26] -1.259310737 0.374443954 1.775710046 0.456071449 -0.433735979 [31] 0.031586300 -1.323923967 0.214797765 -0.534669391 0.079098228 [36] 0.065572196 0.452380048 0.001188623 -0.316185870 0.976597432 [41] -0.390966787 -0.607339619 -1.188298050 0.023769885 -1.023111173 [46] -1.381533999 -1.264121390 -1.597365038 0.054749127 1.191622591 [51] -0.516898293 -1.132177436 0.490700861 -0.312115498 2.567786085 [56] -0.571962721 -0.203106017 -0.361444802 -0.719425801 -1.163453466 [61] -0.535501333 0.027114245 1.646757232 -1.141026104 0.475684368 [66] -1.279443338 0.698925651 -2.047257259 -0.041163593 0.589773277 [71] 1.707253357 0.937907535 -0.864684329 -0.197564595 -0.364027487 [76] 0.183202595 -1.608243515 1.154745716 -0.224622248 0.133510599 [81] -0.548408326 -0.427018552 0.289101453 0.049402748 0.208533731 [86] -0.055802092 1.727144851 0.665139886 -1.706761077 -0.164372230 [91] -0.222822912 -0.531292372 -1.145159268 1.261884983 -0.202399260 [96] -1.254196233 -1.005347536 -0.747116016 1.629272619 1.573616112 > rowMin(tmp2) [1] -0.997615300 -0.475221351 0.619307253 0.209837573 0.835796912 [6] -0.376128594 -0.820359128 0.026511281 -1.429746789 -0.893470333 [11] -0.622878261 -0.450309964 1.832653692 1.191781462 -0.983687933 [16] 0.115050295 -0.884553916 1.947897926 -1.014516122 1.086185288 [21] -0.986882577 0.273998114 -1.322045921 -0.617871359 1.061904526 [26] -1.259310737 0.374443954 1.775710046 0.456071449 -0.433735979 [31] 0.031586300 -1.323923967 0.214797765 -0.534669391 0.079098228 [36] 0.065572196 0.452380048 0.001188623 -0.316185870 0.976597432 [41] -0.390966787 -0.607339619 -1.188298050 0.023769885 -1.023111173 [46] -1.381533999 -1.264121390 -1.597365038 0.054749127 1.191622591 [51] -0.516898293 -1.132177436 0.490700861 -0.312115498 2.567786085 [56] -0.571962721 -0.203106017 -0.361444802 -0.719425801 -1.163453466 [61] -0.535501333 0.027114245 1.646757232 -1.141026104 0.475684368 [66] -1.279443338 0.698925651 -2.047257259 -0.041163593 0.589773277 [71] 1.707253357 0.937907535 -0.864684329 -0.197564595 -0.364027487 [76] 0.183202595 -1.608243515 1.154745716 -0.224622248 0.133510599 [81] -0.548408326 -0.427018552 0.289101453 0.049402748 0.208533731 [86] -0.055802092 1.727144851 0.665139886 -1.706761077 -0.164372230 [91] -0.222822912 -0.531292372 -1.145159268 1.261884983 -0.202399260 [96] -1.254196233 -1.005347536 -0.747116016 1.629272619 1.573616112 > > colMeans(tmp2) [1] -0.1157469 > colSums(tmp2) [1] -11.57469 > colVars(tmp2) [1] 0.9142491 > colSd(tmp2) [1] 0.9561637 > colMax(tmp2) [1] 2.567786 > colMin(tmp2) [1] -2.047257 > colMedians(tmp2) [1] -0.2129645 > colRanges(tmp2) [,1] [1,] -2.047257 [2,] 2.567786 > > 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] -1.48947345 2.79255595 -3.28362739 -2.19944934 -8.86772806 0.30546782 [7] -2.40466958 2.15140258 -2.44462801 -0.09453025 > colApply(tmp,quantile)[,1] [,1] [1,] -1.4535708 [2,] -1.0163557 [3,] -0.3640047 [4,] 0.5970466 [5,] 1.6014355 > > rowApply(tmp,sum) [1] -3.720101 -5.789919 1.790868 -1.516914 -4.835193 2.899398 3.755402 [8] -2.059509 -3.177502 -2.881210 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 5 8 4 10 2 10 3 7 3 [2,] 4 9 4 7 5 5 9 10 10 7 [3,] 5 3 9 1 2 8 3 1 8 9 [4,] 10 7 6 5 1 10 5 7 2 4 [5,] 7 1 1 2 6 9 1 6 6 1 [6,] 2 10 3 10 3 4 7 8 5 2 [7,] 9 6 5 6 4 7 6 4 3 5 [8,] 3 4 10 8 9 6 8 9 4 6 [9,] 8 8 7 3 7 3 2 5 1 8 [10,] 6 2 2 9 8 1 4 2 9 10 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] -5.8810827 1.4939712 2.9321616 2.2513649 1.2091041 -3.7874535 [7] 3.0449711 1.3835045 2.9584659 1.0085233 0.2507914 -0.8905833 [13] 3.7353466 0.1244761 0.9867240 1.3794274 0.3676907 -0.3187540 [19] 0.2141401 -2.4531330 > colApply(tmp,quantile)[,1] [,1] [1,] -2.429130353 [2,] -2.378947802 [3,] -0.792344117 [4,] -0.285090960 [5,] 0.004430545 > > rowApply(tmp,sum) [1] 3.2947351 1.3270263 3.6199162 -0.2080729 1.9760518 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 10 1 7 2 6 [2,] 16 17 11 11 8 [3,] 17 7 5 20 11 [4,] 8 9 17 18 10 [5,] 5 19 15 12 7 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 0.004430545 1.03897720 1.20339817 -0.145281963 -0.52297184 0.6804139 [2,] -2.429130353 1.06270126 -0.26932380 0.005641668 1.68032995 -1.1585707 [3,] -0.285090960 0.04608560 -0.40629983 0.974758732 0.71233966 -1.2855093 [4,] -2.378947802 -0.07928979 2.36321559 1.403211188 0.01697927 -0.6505661 [5,] -0.792344117 -0.57450311 0.04117148 0.013035310 -0.67757294 -1.3732213 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.6975789 -0.03774622 1.7002056 -1.80413071 0.7008887 -0.1884998 [2,] -1.0598185 0.38144948 -0.5619369 0.42190701 -1.3938157 0.8725410 [3,] 2.1119968 0.57528195 1.4300397 0.08700459 0.6202407 -0.8837174 [4,] 0.2515970 0.55685050 -0.6352208 -0.15172788 -0.2974406 0.4039549 [5,] 1.0436169 -0.09233122 1.0253783 2.45547033 0.6209182 -1.0948620 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 1.7262214 0.44569278 -1.4304531 -0.7772227 -0.4233659 -1.39941619 [2,] -0.2013346 0.52646982 1.1374488 0.3793877 1.6980762 0.76049778 [3,] -0.9476914 -0.25753063 -0.3706166 1.1883733 0.8020642 0.02891657 [4,] 1.1488584 -0.65799278 1.0167129 -0.1054954 -0.3793787 1.70132456 [5,] 2.0092928 0.06783688 0.6336320 0.6943845 -1.3297052 -1.41007667 [,19] [,20] [1,] 0.43935751 1.3866589 [2,] -0.75208744 0.2265936 [3,] -0.06847016 -0.4522595 [4,] -1.08400297 -2.6507145 [5,] 1.67934315 -0.9634115 > > > 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 : 650 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 : 561 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 row1 0.4878172 -0.05388675 -0.05478009 -0.3809122 0.2056406 -0.9217816 col7 col8 col9 col10 col11 col12 col13 row1 -0.08308938 0.3873107 0.3350845 -0.945045 0.06086985 1.368363 -0.6000703 col14 col15 col16 col17 col18 col19 col20 row1 -1.741415 0.1763835 0.06764084 -0.545713 -0.3543723 -0.668765 0.5319062 > tmp[,"col10"] col10 row1 -0.9450450 row2 -1.0032579 row3 1.4684291 row4 0.9361034 row5 -0.1268623 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 0.4878172 -0.05388675 -0.05478009 -0.3809122 0.2056406 -0.9217816 row5 -1.0697525 0.53834907 -0.29865440 -1.3733055 2.1583249 -0.1623486 col7 col8 col9 col10 col11 col12 row1 -0.08308938 0.3873107 0.3350845 -0.9450450 0.06086985 1.36836325 row5 0.47071441 0.4664102 0.2931337 -0.1268623 0.22411218 -0.05480534 col13 col14 col15 col16 col17 col18 row1 -0.6000703 -1.7414146 0.1763835 0.06764084 -0.545713 -0.3543723 row5 -1.3648438 0.6133424 -0.1497811 1.75922828 2.145150 -0.3640589 col19 col20 row1 -0.6687650 0.5319062 row5 0.9458827 -0.9148292 > tmp[,c("col6","col20")] col6 col20 row1 -0.92178155 0.5319062 row2 -0.04354018 -0.3957555 row3 1.33393068 1.3907304 row4 -1.03569483 0.5689132 row5 -0.16234858 -0.9148292 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 -0.9217816 0.5319062 row5 -0.1623486 -0.9148292 > > > > > 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 51.98368 50.17645 49.96153 49.49988 48.66725 102.8619 50.81448 50.75074 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.18494 48.44393 48.96422 51.35673 49.60539 49.90518 50.12422 49.18819 col17 col18 col19 col20 row1 50.08219 49.82349 51.70181 104.7192 > tmp[,"col10"] col10 row1 48.44393 row2 30.25837 row3 30.48337 row4 29.17493 row5 50.07578 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 51.98368 50.17645 49.96153 49.49988 48.66725 102.8619 50.81448 50.75074 row5 49.90047 48.57997 50.46586 50.00653 50.87426 104.3802 51.36551 48.82975 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.18494 48.44393 48.96422 51.35673 49.60539 49.90518 50.12422 49.18819 row5 47.68491 50.07578 50.06209 49.56033 49.02208 49.98191 49.97318 48.57295 col17 col18 col19 col20 row1 50.08219 49.82349 51.70181 104.7192 row5 49.42503 48.53249 49.29024 104.0537 > tmp[,c("col6","col20")] col6 col20 row1 102.86186 104.71919 row2 77.21886 75.39554 row3 74.99757 74.64733 row4 74.06215 76.14149 row5 104.38022 104.05367 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 102.8619 104.7192 row5 104.3802 104.0537 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 102.8619 104.7192 row5 104.3802 104.0537 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] 0.4477569 [2,] 0.5031651 [3,] 0.7885661 [4,] -0.8618843 [5,] 1.7555372 > tmp[,c("col17","col7")] col17 col7 [1,] -0.5371661 2.6335995 [2,] -0.4087740 0.3439235 [3,] -0.4638347 0.5728623 [4,] -0.1363557 -0.6199231 [5,] 0.5993739 -1.2262329 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] 0.05850604 0.6940291 [2,] 1.12066278 -2.0997041 [3,] -0.53474446 1.2854220 [4,] -1.01962665 -1.2083515 [5,] 0.73421306 0.3244660 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] 0.05850604 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] 0.05850604 [2,] 1.12066278 > > > > 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.1531805 1.2690781 -0.6334065 -0.5236949 -0.5466005 0.2842706 row1 0.4027528 0.9918599 0.8315546 0.7478209 0.3763849 -0.4373755 [,7] [,8] [,9] [,10] [,11] [,12] row3 -0.02351841 1.3339358 -0.4982294 -0.2445294 -0.7878004 -0.2865587 row1 0.80680054 -0.0766302 1.4551335 1.7196997 1.0404628 0.9986196 [,13] [,14] [,15] [,16] [,17] [,18] row3 1.1512715 -0.4653894 1.3489411 -0.8708777 0.09194844 1.29550002 row1 -0.4629406 -0.6568145 0.5269672 -0.3144217 1.50856425 -0.09888245 [,19] [,20] row3 0.3847100 -1.22597160 row1 0.5450959 0.03158325 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.9030957 -0.4423218 -3.091061 -1.043333 -1.196193 1.521848 1.622884 [,8] [,9] [,10] row2 0.3241427 -1.535989 0.8182228 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -0.8630429 -0.8337911 -0.5143448 0.6674852 -0.941647 -0.2633378 -2.421922 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -0.3552258 1.364131 0.2153882 -2.449577 0.181827 -0.7782587 -0.2698037 [,15] [,16] [,17] [,18] [,19] [,20] row5 -0.5342172 1.876376 0.7627076 -0.3178997 0.3152279 0.361257 > > > 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: 0x600002528180> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435943ee838b" [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43595ffe3d84" [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43592c78d658" [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435931404237" [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435971bb4223" [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43593cf3422a" [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435967cf2a9" [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM4359751f3892" [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435954bb3550" [10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43594ea942a5" [11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43594a5686fb" [12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435976b7eedd" [13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM435925a32c0f" [14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM43597ba1a016" [15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM4359301543c3" > > > ### 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: 0x600002544240> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x600002544240> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x600002544240> > rowMedians(tmp) [1] -0.420135954 -0.096336427 0.090270857 -0.074705359 0.294709661 [6] -0.078682873 0.894157509 0.140401675 0.590577362 -0.660631527 [11] -0.195250508 -0.054383890 0.314088171 -0.074380408 -0.511088791 [16] -0.090694160 0.317386753 -0.446395924 0.160703673 0.013314169 [21] -0.162109726 0.235811503 0.042632840 0.096569158 -0.236488145 [26] -0.346241861 -0.186226416 -0.383383566 -0.201481356 0.346441849 [31] 0.343695256 0.448076872 -0.406902228 -0.007034389 0.387672586 [36] 0.356580795 0.084554554 0.208067965 0.407374029 0.331344231 [41] -0.375264333 -0.124692188 0.079539687 -0.051101688 0.151221586 [46] -0.012014000 -0.125005198 -0.497324155 0.395725958 0.610054198 [51] 0.320795392 0.444793338 -0.417036232 0.441257618 -0.044773710 [56] -0.317181912 -0.227436740 -0.448132138 -0.765089258 -0.061542415 [61] 0.073838319 0.239268040 0.701422186 0.090447911 0.035625310 [66] -0.474268677 -0.253551930 -0.043665771 -0.147949093 0.104082217 [71] -0.479456754 0.086241529 -0.146403806 -0.101216472 0.104618177 [76] -0.441494401 0.087562122 -0.393308893 -0.314043978 -0.643341324 [81] 0.469819616 -0.391536226 0.042696034 0.298788179 -0.097593497 [86] 0.562517868 0.024303266 0.575252015 -0.261504821 -0.499592911 [91] -0.124729032 0.435773358 0.115477920 0.342695656 -0.082478098 [96] -0.291362688 0.173698363 0.251548027 0.287326220 0.153430970 [101] -0.074803023 0.055269251 -0.125256897 -0.156124401 -0.066826387 [106] -0.392338287 -0.328069965 0.011279959 -0.178993358 0.558395817 [111] -0.006094315 -0.374196308 -0.155679088 -0.467307385 0.133462316 [116] 0.072015570 -0.130761802 -0.163281382 0.268862526 0.022452090 [121] -0.920496312 0.237797647 -0.095798938 0.521872686 -0.121063747 [126] 0.395987023 0.213310012 -0.284544584 0.263136991 -0.132814903 [131] -0.141789018 -0.346305986 0.398525316 0.554447668 -0.541529863 [136] 0.127905671 0.050026094 0.869086032 0.170180012 0.227951290 [141] 0.855302188 0.267032486 -0.297841874 0.237042012 -0.219391618 [146] 0.480374939 -0.120539847 -0.676140719 0.370856486 0.108321549 [151] 0.552927792 0.205479170 -0.044673240 0.133578923 0.420902107 [156] -0.106311511 -0.304449666 0.016371973 0.432909190 0.434420362 [161] 0.237884428 0.215957868 0.173527433 0.078308853 -0.308739044 [166] 0.252068393 0.224309057 -0.651676291 -0.072161277 -0.329144260 [171] -0.052606082 0.071365019 0.175658551 -0.585760111 -0.099841838 [176] -0.012817081 0.375652333 0.058985049 -0.610733455 -0.077746896 [181] -0.366934368 0.077983558 0.416576776 0.072723332 0.115706418 [186] -0.024421290 0.604372256 0.106446151 -0.119835240 -0.243041740 [191] -0.152158105 0.259845865 0.366104968 -0.373003141 -0.477896905 [196] -0.200081058 0.269439639 0.366310536 -0.114409345 0.188484026 [201] -0.602862133 0.007511055 0.140242286 0.359664230 -0.111810732 [206] 0.018725317 -0.056380121 -0.314847071 -0.519651095 0.276114710 [211] -0.447763811 0.106340573 0.224027919 0.149719583 0.163596845 [216] 0.742793247 -0.113560595 -0.157315394 0.240834378 0.379627293 [221] 0.083365001 0.322888805 -0.159881760 0.030381490 0.490409581 [226] 0.280474985 0.321649551 0.165544950 -0.320045196 -0.412567796 > > proc.time() user system elapsed 2.728 16.444 20.722
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" 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: 0x6000010cc000> > .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: 0x6000010cc000> > .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: 0x6000010cc000> > .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: 0x6000010cc000> > 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: 0x6000010fc000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000010fc000> > .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: 0x6000010fc000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000010fc000> > .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: 0x6000010fc000> > 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: 0x6000010b8180> > .Call("R_bm_AddColumn",P) <pointer: 0x6000010b8180> > .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: 0x6000010b8180> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x6000010b8180> > .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: 0x6000010b8180> > > .Call("R_bm_RowMode",P) <pointer: 0x6000010b8180> > .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: 0x6000010b8180> > > .Call("R_bm_ColMode",P) <pointer: 0x6000010b8180> > .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: 0x6000010b8180> > 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: 0x600001084000> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x600001084000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001084000> > .Call("R_bm_AddColumn",P) <pointer: 0x600001084000> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile49e6416120f8" "BufferedMatrixFile49e64fbb9b50" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile49e6416120f8" "BufferedMatrixFile49e64fbb9b50" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001084240> > .Call("R_bm_AddColumn",P) <pointer: 0x600001084240> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001084240> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001084240> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x600001084240> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x600001084240> > .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: 0x600001084420> > .Call("R_bm_AddColumn",P) <pointer: 0x600001084420> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001084420> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x600001084420> > 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: 0x600001084600> > .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: 0x600001084600> > rm(P) > > proc.time() user system elapsed 0.352 0.172 0.526
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" 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.385 0.100 0.485