Back to Multiple platform build/check report for BioC 3.21: simplified long |
|
This page was generated on 2025-01-21 11:43 -0500 (Tue, 21 Jan 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo1 | Linux (Ubuntu 24.04.1 LTS) | x86_64 | R Under development (unstable) (2024-10-21 r87258) -- "Unsuffered Consequences" | 4777 |
palomino7 | Windows Server 2022 Datacenter | x64 | R Under development (unstable) (2024-10-26 r87273 ucrt) -- "Unsuffered Consequences" | 4502 |
lconway | macOS 12.7.1 Monterey | x86_64 | R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" | 4467 |
kjohnson3 | macOS 13.7.1 Ventura | arm64 | R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" | 4422 |
kunpeng2 | Linux (openEuler 22.03 LTS-SP1) | aarch64 | R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" | 4406 |
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 246/2286 | 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 | |||||||||
kunpeng2 | Linux (openEuler 22.03 LTS-SP1) / 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.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-01-20 19:31:07 -0500 (Mon, 20 Jan 2025) |
EndedAt: 2025-01-20 19:32:00 -0500 (Mon, 20 Jan 2025) |
EllapsedTime: 52.6 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) (2024-11-20 r87352) * 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.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’ ... ** 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) (2024-11-20 r87352) -- "Unsuffered Consequences" Copyright (C) 2024 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.340 0.146 0.504
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" Copyright (C) 2024 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 480590 25.7 1055740 56.4 NA 634748 33.9 Vcells 890091 6.8 8388608 64.0 98304 2107434 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 Jan 20 19:31:32 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 Jan 20 19:31:32 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: 0x6000030e00c0> > > > > 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 Jan 20 19:31:37 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 Jan 20 19:31:38 2025" > > ColMode(tmp2) <pointer: 0x6000030e00c0> > > > > ### 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.0870338 2.1964485 -0.8900042 0.4060918 [2,] -0.6654469 -1.3988380 -0.1978685 -0.3349788 [3,] 1.2047382 -1.0333158 -1.1175327 -0.3672493 [4,] -0.6069746 -0.1057214 -0.2139012 0.3995975 > 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.0870338 2.1964485 0.8900042 0.4060918 [2,] 0.6654469 1.3988380 0.1978685 0.3349788 [3,] 1.2047382 1.0333158 1.1175327 0.3672493 [4,] 0.6069746 0.1057214 0.2139012 0.3995975 > 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.0043507 1.4820420 0.9434003 0.6372534 [2,] 0.8157493 1.1827248 0.4448241 0.5787736 [3,] 1.0976057 1.0165214 1.0571342 0.6060110 [4,] 0.7790857 0.3251482 0.4624946 0.6321372 > > 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.13054 42.01687 35.32401 31.77863 [2,] 33.82294 38.22609 29.64611 31.12271 [3,] 37.18080 36.19853 36.68887 31.42736 [4,] 33.39783 28.35720 29.83885 31.72097 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x6000030dc240> > exp(tmp5) <pointer: 0x6000030dc240> > log(tmp5,2) <pointer: 0x6000030dc240> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 468.5797 > Min(tmp5) [1] 54.22784 > mean(tmp5) [1] 72.31446 > Sum(tmp5) [1] 14462.89 > Var(tmp5) [1] 857.672 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 92.26087 70.28460 69.97322 69.19694 68.42467 72.05196 68.11898 71.12732 [9] 70.71326 70.99277 > rowSums(tmp5) [1] 1845.217 1405.692 1399.464 1383.939 1368.493 1441.039 1362.380 1422.546 [9] 1414.265 1419.855 > rowVars(tmp5) [1] 7909.26459 84.51299 73.97804 58.16676 61.10036 63.14738 [7] 42.59906 63.08381 89.05920 58.38747 > rowSd(tmp5) [1] 88.934046 9.193095 8.601049 7.626714 7.816672 7.946533 6.526795 [8] 7.942532 9.437118 7.641169 > rowMax(tmp5) [1] 468.57973 88.67561 84.56922 80.07010 83.13577 83.90985 77.81611 [8] 90.30542 86.77872 85.97050 > rowMin(tmp5) [1] 56.59110 57.23236 56.65419 58.43694 54.22784 58.14901 56.84137 57.89553 [9] 55.16816 60.24077 > > colMeans(tmp5) [1] 111.31413 75.74393 66.36432 71.98283 69.81982 71.49938 65.64662 [8] 71.03483 70.18866 70.01145 73.94100 68.51056 69.60971 74.39173 [15] 68.15587 68.56884 70.61103 63.22061 72.06422 73.60968 > colSums(tmp5) [1] 1113.1413 757.4393 663.6432 719.8283 698.1982 714.9938 656.4662 [8] 710.3483 701.8866 700.1145 739.4100 685.1056 696.0971 743.9173 [15] 681.5587 685.6884 706.1103 632.2061 720.6422 736.0968 > colVars(tmp5) [1] 15800.92674 68.69207 38.38798 46.53162 31.04363 60.42068 [7] 63.30603 51.20710 50.77957 110.27708 115.61969 106.50671 [13] 90.04392 45.58269 39.71676 73.94961 39.41503 19.32406 [19] 60.46491 75.81012 > colSd(tmp5) [1] 125.701737 8.288068 6.195804 6.821409 5.571681 7.773074 [7] 7.956509 7.155914 7.125978 10.501290 10.752660 10.320209 [13] 9.489147 6.751495 6.302123 8.599396 6.278139 4.395914 [19] 7.775919 8.706901 > colMax(tmp5) [1] 468.57973 87.45261 76.36308 85.97050 76.77787 81.29898 77.43790 [8] 84.51542 83.89242 86.73598 88.67561 90.30542 83.90985 84.56922 [15] 79.67269 80.48698 78.06874 68.21770 83.74988 86.77872 > colMin(tmp5) [1] 60.24077 59.02180 58.81769 64.77785 57.23236 55.16816 56.84137 61.65422 [9] 58.14901 59.43055 56.65419 59.10392 55.19283 62.10926 60.71951 58.43694 [17] 56.59110 54.22784 58.65823 61.92138 > > > ### 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] 92.26087 70.28460 NA 69.19694 68.42467 72.05196 68.11898 71.12732 [9] 70.71326 70.99277 > rowSums(tmp5) [1] 1845.217 1405.692 NA 1383.939 1368.493 1441.039 1362.380 1422.546 [9] 1414.265 1419.855 > rowVars(tmp5) [1] 7909.26459 84.51299 75.14164 58.16676 61.10036 63.14738 [7] 42.59906 63.08381 89.05920 58.38747 > rowSd(tmp5) [1] 88.934046 9.193095 8.668428 7.626714 7.816672 7.946533 6.526795 [8] 7.942532 9.437118 7.641169 > rowMax(tmp5) [1] 468.57973 88.67561 NA 80.07010 83.13577 83.90985 77.81611 [8] 90.30542 86.77872 85.97050 > rowMin(tmp5) [1] 56.59110 57.23236 NA 58.43694 54.22784 58.14901 56.84137 57.89553 [9] 55.16816 60.24077 > > colMeans(tmp5) [1] 111.31413 75.74393 66.36432 71.98283 69.81982 NA 65.64662 [8] 71.03483 70.18866 70.01145 73.94100 68.51056 69.60971 74.39173 [15] 68.15587 68.56884 70.61103 63.22061 72.06422 73.60968 > colSums(tmp5) [1] 1113.1413 757.4393 663.6432 719.8283 698.1982 NA 656.4662 [8] 710.3483 701.8866 700.1145 739.4100 685.1056 696.0971 743.9173 [15] 681.5587 685.6884 706.1103 632.2061 720.6422 736.0968 > colVars(tmp5) [1] 15800.92674 68.69207 38.38798 46.53162 31.04363 NA [7] 63.30603 51.20710 50.77957 110.27708 115.61969 106.50671 [13] 90.04392 45.58269 39.71676 73.94961 39.41503 19.32406 [19] 60.46491 75.81012 > colSd(tmp5) [1] 125.701737 8.288068 6.195804 6.821409 5.571681 NA [7] 7.956509 7.155914 7.125978 10.501290 10.752660 10.320209 [13] 9.489147 6.751495 6.302123 8.599396 6.278139 4.395914 [19] 7.775919 8.706901 > colMax(tmp5) [1] 468.57973 87.45261 76.36308 85.97050 76.77787 NA 77.43790 [8] 84.51542 83.89242 86.73598 88.67561 90.30542 83.90985 84.56922 [15] 79.67269 80.48698 78.06874 68.21770 83.74988 86.77872 > colMin(tmp5) [1] 60.24077 59.02180 58.81769 64.77785 57.23236 NA 56.84137 61.65422 [9] 58.14901 59.43055 56.65419 59.10392 55.19283 62.10926 60.71951 58.43694 [17] 56.59110 54.22784 58.65823 61.92138 > > Max(tmp5,na.rm=TRUE) [1] 468.5797 > Min(tmp5,na.rm=TRUE) [1] 54.22784 > mean(tmp5,na.rm=TRUE) [1] 72.36189 > Sum(tmp5,na.rm=TRUE) [1] 14400.02 > Var(tmp5,na.rm=TRUE) [1] 861.5514 > > rowMeans(tmp5,na.rm=TRUE) [1] 92.26087 70.28460 70.34680 69.19694 68.42467 72.05196 68.11898 71.12732 [9] 70.71326 70.99277 > rowSums(tmp5,na.rm=TRUE) [1] 1845.217 1405.692 1336.589 1383.939 1368.493 1441.039 1362.380 1422.546 [9] 1414.265 1419.855 > rowVars(tmp5,na.rm=TRUE) [1] 7909.26459 84.51299 75.14164 58.16676 61.10036 63.14738 [7] 42.59906 63.08381 89.05920 58.38747 > rowSd(tmp5,na.rm=TRUE) [1] 88.934046 9.193095 8.668428 7.626714 7.816672 7.946533 6.526795 [8] 7.942532 9.437118 7.641169 > rowMax(tmp5,na.rm=TRUE) [1] 468.57973 88.67561 84.56922 80.07010 83.13577 83.90985 77.81611 [8] 90.30542 86.77872 85.97050 > rowMin(tmp5,na.rm=TRUE) [1] 56.59110 57.23236 56.65419 58.43694 54.22784 58.14901 56.84137 57.89553 [9] 55.16816 60.24077 > > colMeans(tmp5,na.rm=TRUE) [1] 111.31413 75.74393 66.36432 71.98283 69.81982 72.45762 65.64662 [8] 71.03483 70.18866 70.01145 73.94100 68.51056 69.60971 74.39173 [15] 68.15587 68.56884 70.61103 63.22061 72.06422 73.60968 > colSums(tmp5,na.rm=TRUE) [1] 1113.1413 757.4393 663.6432 719.8283 698.1982 652.1186 656.4662 [8] 710.3483 701.8866 700.1145 739.4100 685.1056 696.0971 743.9173 [15] 681.5587 685.6884 706.1103 632.2061 720.6422 736.0968 > colVars(tmp5,na.rm=TRUE) [1] 15800.92674 68.69207 38.38798 46.53162 31.04363 57.64327 [7] 63.30603 51.20710 50.77957 110.27708 115.61969 106.50671 [13] 90.04392 45.58269 39.71676 73.94961 39.41503 19.32406 [19] 60.46491 75.81012 > colSd(tmp5,na.rm=TRUE) [1] 125.701737 8.288068 6.195804 6.821409 5.571681 7.592316 [7] 7.956509 7.155914 7.125978 10.501290 10.752660 10.320209 [13] 9.489147 6.751495 6.302123 8.599396 6.278139 4.395914 [19] 7.775919 8.706901 > colMax(tmp5,na.rm=TRUE) [1] 468.57973 87.45261 76.36308 85.97050 76.77787 81.29898 77.43790 [8] 84.51542 83.89242 86.73598 88.67561 90.30542 83.90985 84.56922 [15] 79.67269 80.48698 78.06874 68.21770 83.74988 86.77872 > colMin(tmp5,na.rm=TRUE) [1] 60.24077 59.02180 58.81769 64.77785 57.23236 55.16816 56.84137 61.65422 [9] 58.14901 59.43055 56.65419 59.10392 55.19283 62.10926 60.71951 58.43694 [17] 56.59110 54.22784 58.65823 61.92138 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 92.26087 70.28460 NaN 69.19694 68.42467 72.05196 68.11898 71.12732 [9] 70.71326 70.99277 > rowSums(tmp5,na.rm=TRUE) [1] 1845.217 1405.692 0.000 1383.939 1368.493 1441.039 1362.380 1422.546 [9] 1414.265 1419.855 > rowVars(tmp5,na.rm=TRUE) [1] 7909.26459 84.51299 NA 58.16676 61.10036 63.14738 [7] 42.59906 63.08381 89.05920 58.38747 > rowSd(tmp5,na.rm=TRUE) [1] 88.934046 9.193095 NA 7.626714 7.816672 7.946533 6.526795 [8] 7.942532 9.437118 7.641169 > rowMax(tmp5,na.rm=TRUE) [1] 468.57973 88.67561 NA 80.07010 83.13577 83.90985 77.81611 [8] 90.30542 86.77872 85.97050 > rowMin(tmp5,na.rm=TRUE) [1] 56.59110 57.23236 NA 58.43694 54.22784 58.14901 56.84137 57.89553 [9] 55.16816 60.24077 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 115.08381 75.78853 65.25334 72.71292 69.88534 NaN 66.42200 [8] 70.76386 71.08787 71.18711 75.86175 67.78786 68.52214 73.26089 [15] 67.46499 69.57261 71.09222 63.09480 70.76581 73.42644 > colSums(tmp5,na.rm=TRUE) [1] 1035.7543 682.0968 587.2801 654.4163 628.9680 0.0000 597.7980 [8] 636.8748 639.7908 640.6840 682.7558 610.0908 616.6993 659.3481 [15] 607.1849 626.1535 639.8300 567.8532 636.8923 660.8380 > colVars(tmp5,na.rm=TRUE) [1] 17616.17410 77.25619 29.30101 46.35132 34.87579 NA [7] 64.45569 56.78197 48.03053 108.51233 88.56746 113.94427 [13] 87.99300 36.89423 39.31154 71.85820 41.73702 21.56150 [19] 49.05709 84.90867 > colSd(tmp5,na.rm=TRUE) [1] 132.725936 8.789550 5.413041 6.808180 5.905573 NA [7] 8.028430 7.535381 6.930406 10.416925 9.411029 10.674468 [13] 9.380458 6.074062 6.269892 8.476922 6.460420 4.643437 [19] 7.004077 9.214590 > colMax(tmp5,na.rm=TRUE) [1] 468.57973 87.45261 73.52229 85.97050 76.77787 -Inf 77.43790 [8] 84.51542 83.89242 86.73598 88.67561 90.30542 83.90985 81.35663 [15] 79.67269 80.48698 78.06874 68.21770 79.88312 86.77872 > colMin(tmp5,na.rm=TRUE) [1] 60.24077 59.02180 58.81769 64.77785 57.23236 Inf 56.84137 61.65422 [9] 58.14901 60.30111 62.60688 59.10392 55.19283 62.10926 60.71951 58.43694 [17] 56.59110 54.22784 58.65823 61.92138 > > > > > 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] 244.6748 341.6643 146.2653 223.7685 245.6688 251.6765 183.2186 274.4523 [9] 260.3191 219.1323 > apply(copymatrix,1,var,na.rm=TRUE) [1] 244.6748 341.6643 146.2653 223.7685 245.6688 251.6765 183.2186 274.4523 [9] 260.3191 219.1323 > > > > 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] -5.684342e-14 0.000000e+00 2.842171e-14 -1.136868e-13 2.842171e-14 [6] 1.421085e-13 -1.421085e-14 -2.842171e-14 5.684342e-14 8.526513e-14 [11] 7.105427e-14 1.705303e-13 4.263256e-14 2.842171e-14 -1.705303e-13 [16] -1.136868e-13 1.705303e-13 1.136868e-13 5.684342e-14 7.105427e-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) + } 4 20 9 20 8 3 8 15 7 14 3 13 2 10 6 16 6 1 8 18 8 6 2 5 2 5 5 19 3 15 6 11 7 11 8 20 6 17 10 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.011913 > Min(tmp) [1] -2.425751 > mean(tmp) [1] 0.1633769 > Sum(tmp) [1] 16.33769 > Var(tmp) [1] 0.9402926 > > rowMeans(tmp) [1] 0.1633769 > rowSums(tmp) [1] 16.33769 > rowVars(tmp) [1] 0.9402926 > rowSd(tmp) [1] 0.9696869 > rowMax(tmp) [1] 2.011913 > rowMin(tmp) [1] -2.425751 > > colMeans(tmp) [1] -0.503221564 -0.037638355 0.624734587 -0.772864047 -0.052761949 [6] -0.261058751 0.598161664 0.201287687 -0.304666933 0.021769457 [11] 0.516147764 1.444598840 -1.748995122 1.941669782 -0.973738715 [16] 1.763985639 0.251534353 -1.931274142 1.377542369 0.757104177 [21] 1.135064355 1.611119126 -0.346865517 -0.062769553 1.110332851 [26] -1.065013179 1.256145847 -0.118880453 -0.569152674 0.715474622 [31] -0.838942218 0.775245137 -0.457842605 1.206757614 -1.519760803 [36] 1.535291902 -1.040180403 -0.213669057 0.078696522 -0.071857255 [41] -0.197115747 -0.395152201 -0.902327053 0.365658248 -0.398799924 [46] 0.447102581 -0.986138384 0.652398941 -0.690650328 1.761931089 [51] -0.790045325 0.719601686 -0.139071322 0.082975897 0.147936555 [56] -0.561397990 0.400850639 0.940730145 2.011912622 0.363753044 [61] -1.044805958 -0.086946378 -1.049832611 0.050725230 0.145902728 [66] -0.200290747 -0.130718495 -0.911879480 1.184237483 -0.154907555 [71] 1.274855436 -2.425751055 1.702347959 1.280175693 -1.135560769 [76] -0.369584780 1.542912775 0.105846831 -0.005451855 -0.686686777 [81] 0.781803368 -1.432026835 1.095071950 -0.474329414 1.672041561 [86] -0.695114744 1.152916073 0.757920046 1.312179794 1.766190644 [91] -0.169088100 1.301822350 1.191108322 -1.551120483 1.717295534 [96] 0.241919939 -0.289882594 0.115512001 0.018493245 -0.125279267 > colSums(tmp) [1] -0.503221564 -0.037638355 0.624734587 -0.772864047 -0.052761949 [6] -0.261058751 0.598161664 0.201287687 -0.304666933 0.021769457 [11] 0.516147764 1.444598840 -1.748995122 1.941669782 -0.973738715 [16] 1.763985639 0.251534353 -1.931274142 1.377542369 0.757104177 [21] 1.135064355 1.611119126 -0.346865517 -0.062769553 1.110332851 [26] -1.065013179 1.256145847 -0.118880453 -0.569152674 0.715474622 [31] -0.838942218 0.775245137 -0.457842605 1.206757614 -1.519760803 [36] 1.535291902 -1.040180403 -0.213669057 0.078696522 -0.071857255 [41] -0.197115747 -0.395152201 -0.902327053 0.365658248 -0.398799924 [46] 0.447102581 -0.986138384 0.652398941 -0.690650328 1.761931089 [51] -0.790045325 0.719601686 -0.139071322 0.082975897 0.147936555 [56] -0.561397990 0.400850639 0.940730145 2.011912622 0.363753044 [61] -1.044805958 -0.086946378 -1.049832611 0.050725230 0.145902728 [66] -0.200290747 -0.130718495 -0.911879480 1.184237483 -0.154907555 [71] 1.274855436 -2.425751055 1.702347959 1.280175693 -1.135560769 [76] -0.369584780 1.542912775 0.105846831 -0.005451855 -0.686686777 [81] 0.781803368 -1.432026835 1.095071950 -0.474329414 1.672041561 [86] -0.695114744 1.152916073 0.757920046 1.312179794 1.766190644 [91] -0.169088100 1.301822350 1.191108322 -1.551120483 1.717295534 [96] 0.241919939 -0.289882594 0.115512001 0.018493245 -0.125279267 > 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.503221564 -0.037638355 0.624734587 -0.772864047 -0.052761949 [6] -0.261058751 0.598161664 0.201287687 -0.304666933 0.021769457 [11] 0.516147764 1.444598840 -1.748995122 1.941669782 -0.973738715 [16] 1.763985639 0.251534353 -1.931274142 1.377542369 0.757104177 [21] 1.135064355 1.611119126 -0.346865517 -0.062769553 1.110332851 [26] -1.065013179 1.256145847 -0.118880453 -0.569152674 0.715474622 [31] -0.838942218 0.775245137 -0.457842605 1.206757614 -1.519760803 [36] 1.535291902 -1.040180403 -0.213669057 0.078696522 -0.071857255 [41] -0.197115747 -0.395152201 -0.902327053 0.365658248 -0.398799924 [46] 0.447102581 -0.986138384 0.652398941 -0.690650328 1.761931089 [51] -0.790045325 0.719601686 -0.139071322 0.082975897 0.147936555 [56] -0.561397990 0.400850639 0.940730145 2.011912622 0.363753044 [61] -1.044805958 -0.086946378 -1.049832611 0.050725230 0.145902728 [66] -0.200290747 -0.130718495 -0.911879480 1.184237483 -0.154907555 [71] 1.274855436 -2.425751055 1.702347959 1.280175693 -1.135560769 [76] -0.369584780 1.542912775 0.105846831 -0.005451855 -0.686686777 [81] 0.781803368 -1.432026835 1.095071950 -0.474329414 1.672041561 [86] -0.695114744 1.152916073 0.757920046 1.312179794 1.766190644 [91] -0.169088100 1.301822350 1.191108322 -1.551120483 1.717295534 [96] 0.241919939 -0.289882594 0.115512001 0.018493245 -0.125279267 > colMin(tmp) [1] -0.503221564 -0.037638355 0.624734587 -0.772864047 -0.052761949 [6] -0.261058751 0.598161664 0.201287687 -0.304666933 0.021769457 [11] 0.516147764 1.444598840 -1.748995122 1.941669782 -0.973738715 [16] 1.763985639 0.251534353 -1.931274142 1.377542369 0.757104177 [21] 1.135064355 1.611119126 -0.346865517 -0.062769553 1.110332851 [26] -1.065013179 1.256145847 -0.118880453 -0.569152674 0.715474622 [31] -0.838942218 0.775245137 -0.457842605 1.206757614 -1.519760803 [36] 1.535291902 -1.040180403 -0.213669057 0.078696522 -0.071857255 [41] -0.197115747 -0.395152201 -0.902327053 0.365658248 -0.398799924 [46] 0.447102581 -0.986138384 0.652398941 -0.690650328 1.761931089 [51] -0.790045325 0.719601686 -0.139071322 0.082975897 0.147936555 [56] -0.561397990 0.400850639 0.940730145 2.011912622 0.363753044 [61] -1.044805958 -0.086946378 -1.049832611 0.050725230 0.145902728 [66] -0.200290747 -0.130718495 -0.911879480 1.184237483 -0.154907555 [71] 1.274855436 -2.425751055 1.702347959 1.280175693 -1.135560769 [76] -0.369584780 1.542912775 0.105846831 -0.005451855 -0.686686777 [81] 0.781803368 -1.432026835 1.095071950 -0.474329414 1.672041561 [86] -0.695114744 1.152916073 0.757920046 1.312179794 1.766190644 [91] -0.169088100 1.301822350 1.191108322 -1.551120483 1.717295534 [96] 0.241919939 -0.289882594 0.115512001 0.018493245 -0.125279267 > colMedians(tmp) [1] -0.503221564 -0.037638355 0.624734587 -0.772864047 -0.052761949 [6] -0.261058751 0.598161664 0.201287687 -0.304666933 0.021769457 [11] 0.516147764 1.444598840 -1.748995122 1.941669782 -0.973738715 [16] 1.763985639 0.251534353 -1.931274142 1.377542369 0.757104177 [21] 1.135064355 1.611119126 -0.346865517 -0.062769553 1.110332851 [26] -1.065013179 1.256145847 -0.118880453 -0.569152674 0.715474622 [31] -0.838942218 0.775245137 -0.457842605 1.206757614 -1.519760803 [36] 1.535291902 -1.040180403 -0.213669057 0.078696522 -0.071857255 [41] -0.197115747 -0.395152201 -0.902327053 0.365658248 -0.398799924 [46] 0.447102581 -0.986138384 0.652398941 -0.690650328 1.761931089 [51] -0.790045325 0.719601686 -0.139071322 0.082975897 0.147936555 [56] -0.561397990 0.400850639 0.940730145 2.011912622 0.363753044 [61] -1.044805958 -0.086946378 -1.049832611 0.050725230 0.145902728 [66] -0.200290747 -0.130718495 -0.911879480 1.184237483 -0.154907555 [71] 1.274855436 -2.425751055 1.702347959 1.280175693 -1.135560769 [76] -0.369584780 1.542912775 0.105846831 -0.005451855 -0.686686777 [81] 0.781803368 -1.432026835 1.095071950 -0.474329414 1.672041561 [86] -0.695114744 1.152916073 0.757920046 1.312179794 1.766190644 [91] -0.169088100 1.301822350 1.191108322 -1.551120483 1.717295534 [96] 0.241919939 -0.289882594 0.115512001 0.018493245 -0.125279267 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.5032216 -0.03763835 0.6247346 -0.772864 -0.05276195 -0.2610588 [2,] -0.5032216 -0.03763835 0.6247346 -0.772864 -0.05276195 -0.2610588 [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.5981617 0.2012877 -0.3046669 0.02176946 0.5161478 1.444599 -1.748995 [2,] 0.5981617 0.2012877 -0.3046669 0.02176946 0.5161478 1.444599 -1.748995 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 1.94167 -0.9737387 1.763986 0.2515344 -1.931274 1.377542 0.7571042 [2,] 1.94167 -0.9737387 1.763986 0.2515344 -1.931274 1.377542 0.7571042 [,21] [,22] [,23] [,24] [,25] [,26] [,27] [1,] 1.135064 1.611119 -0.3468655 -0.06276955 1.110333 -1.065013 1.256146 [2,] 1.135064 1.611119 -0.3468655 -0.06276955 1.110333 -1.065013 1.256146 [,28] [,29] [,30] [,31] [,32] [,33] [,34] [1,] -0.1188805 -0.5691527 0.7154746 -0.8389422 0.7752451 -0.4578426 1.206758 [2,] -0.1188805 -0.5691527 0.7154746 -0.8389422 0.7752451 -0.4578426 1.206758 [,35] [,36] [,37] [,38] [,39] [,40] [,41] [1,] -1.519761 1.535292 -1.04018 -0.2136691 0.07869652 -0.07185726 -0.1971157 [2,] -1.519761 1.535292 -1.04018 -0.2136691 0.07869652 -0.07185726 -0.1971157 [,42] [,43] [,44] [,45] [,46] [,47] [,48] [1,] -0.3951522 -0.9023271 0.3656582 -0.3987999 0.4471026 -0.9861384 0.6523989 [2,] -0.3951522 -0.9023271 0.3656582 -0.3987999 0.4471026 -0.9861384 0.6523989 [,49] [,50] [,51] [,52] [,53] [,54] [,55] [1,] -0.6906503 1.761931 -0.7900453 0.7196017 -0.1390713 0.0829759 0.1479366 [2,] -0.6906503 1.761931 -0.7900453 0.7196017 -0.1390713 0.0829759 0.1479366 [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] -0.561398 0.4008506 0.9407301 2.011913 0.363753 -1.044806 -0.08694638 [2,] -0.561398 0.4008506 0.9407301 2.011913 0.363753 -1.044806 -0.08694638 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [1,] -1.049833 0.05072523 0.1459027 -0.2002907 -0.1307185 -0.9118795 1.184237 [2,] -1.049833 0.05072523 0.1459027 -0.2002907 -0.1307185 -0.9118795 1.184237 [,70] [,71] [,72] [,73] [,74] [,75] [,76] [1,] -0.1549076 1.274855 -2.425751 1.702348 1.280176 -1.135561 -0.3695848 [2,] -0.1549076 1.274855 -2.425751 1.702348 1.280176 -1.135561 -0.3695848 [,77] [,78] [,79] [,80] [,81] [,82] [,83] [1,] 1.542913 0.1058468 -0.005451855 -0.6866868 0.7818034 -1.432027 1.095072 [2,] 1.542913 0.1058468 -0.005451855 -0.6866868 0.7818034 -1.432027 1.095072 [,84] [,85] [,86] [,87] [,88] [,89] [,90] [1,] -0.4743294 1.672042 -0.6951147 1.152916 0.75792 1.31218 1.766191 [2,] -0.4743294 1.672042 -0.6951147 1.152916 0.75792 1.31218 1.766191 [,91] [,92] [,93] [,94] [,95] [,96] [,97] [1,] -0.1690881 1.301822 1.191108 -1.55112 1.717296 0.2419199 -0.2898826 [2,] -0.1690881 1.301822 1.191108 -1.55112 1.717296 0.2419199 -0.2898826 [,98] [,99] [,100] [1,] 0.115512 0.01849324 -0.1252793 [2,] 0.115512 0.01849324 -0.1252793 > > > Max(tmp2) [1] 2.217924 > Min(tmp2) [1] -1.856129 > mean(tmp2) [1] 0.01399703 > Sum(tmp2) [1] 1.399703 > Var(tmp2) [1] 0.9353576 > > rowMeans(tmp2) [1] 1.42917062 0.08138089 -0.17365722 0.68575342 -1.61345556 1.09107924 [7] 0.14787085 0.07495533 0.44544636 1.60981518 -1.66609306 0.42809257 [13] -1.80423552 0.38780294 0.56268335 -0.03682069 -0.66787510 0.91875822 [19] -0.18870060 0.77779176 0.48915387 0.99195631 0.02323207 -0.95671620 [25] -0.80824591 1.06762586 0.14019492 -1.44760258 -0.31078028 1.31485572 [31] 1.34759076 -1.33778530 0.99560160 -1.37664050 -0.29276732 -1.51305173 [37] 0.85654781 -1.49543015 -1.40588138 -1.32223018 -0.57521209 1.38550911 [43] 0.15953650 0.79742300 0.46932165 -0.44902067 -1.85612912 0.18562615 [49] -0.86013631 -0.11513006 -0.37810790 -0.67636521 0.69097536 -0.41746065 [55] 1.65578982 -0.44673896 -0.11495633 -0.64281515 -0.46382477 -0.22227100 [61] -0.82627071 0.89629079 0.12621492 -0.52824020 -0.81387700 0.83762625 [67] 0.99866042 1.22877309 0.45193643 -0.24003340 -1.46138618 0.04197982 [73] 0.01610233 0.02270745 0.08358089 0.94089124 0.87703860 2.21792398 [79] 1.08129293 -1.17398672 -1.16284607 0.58281202 2.03582065 0.67174154 [85] 0.34439301 0.98585972 -0.52640509 -0.47903414 -0.22010427 0.24220657 [91] 1.25963054 0.78507475 1.53411279 0.83969048 -0.58457773 -1.36260428 [97] -1.56920360 -1.80106668 -0.75522655 0.22680105 > rowSums(tmp2) [1] 1.42917062 0.08138089 -0.17365722 0.68575342 -1.61345556 1.09107924 [7] 0.14787085 0.07495533 0.44544636 1.60981518 -1.66609306 0.42809257 [13] -1.80423552 0.38780294 0.56268335 -0.03682069 -0.66787510 0.91875822 [19] -0.18870060 0.77779176 0.48915387 0.99195631 0.02323207 -0.95671620 [25] -0.80824591 1.06762586 0.14019492 -1.44760258 -0.31078028 1.31485572 [31] 1.34759076 -1.33778530 0.99560160 -1.37664050 -0.29276732 -1.51305173 [37] 0.85654781 -1.49543015 -1.40588138 -1.32223018 -0.57521209 1.38550911 [43] 0.15953650 0.79742300 0.46932165 -0.44902067 -1.85612912 0.18562615 [49] -0.86013631 -0.11513006 -0.37810790 -0.67636521 0.69097536 -0.41746065 [55] 1.65578982 -0.44673896 -0.11495633 -0.64281515 -0.46382477 -0.22227100 [61] -0.82627071 0.89629079 0.12621492 -0.52824020 -0.81387700 0.83762625 [67] 0.99866042 1.22877309 0.45193643 -0.24003340 -1.46138618 0.04197982 [73] 0.01610233 0.02270745 0.08358089 0.94089124 0.87703860 2.21792398 [79] 1.08129293 -1.17398672 -1.16284607 0.58281202 2.03582065 0.67174154 [85] 0.34439301 0.98585972 -0.52640509 -0.47903414 -0.22010427 0.24220657 [91] 1.25963054 0.78507475 1.53411279 0.83969048 -0.58457773 -1.36260428 [97] -1.56920360 -1.80106668 -0.75522655 0.22680105 > 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.42917062 0.08138089 -0.17365722 0.68575342 -1.61345556 1.09107924 [7] 0.14787085 0.07495533 0.44544636 1.60981518 -1.66609306 0.42809257 [13] -1.80423552 0.38780294 0.56268335 -0.03682069 -0.66787510 0.91875822 [19] -0.18870060 0.77779176 0.48915387 0.99195631 0.02323207 -0.95671620 [25] -0.80824591 1.06762586 0.14019492 -1.44760258 -0.31078028 1.31485572 [31] 1.34759076 -1.33778530 0.99560160 -1.37664050 -0.29276732 -1.51305173 [37] 0.85654781 -1.49543015 -1.40588138 -1.32223018 -0.57521209 1.38550911 [43] 0.15953650 0.79742300 0.46932165 -0.44902067 -1.85612912 0.18562615 [49] -0.86013631 -0.11513006 -0.37810790 -0.67636521 0.69097536 -0.41746065 [55] 1.65578982 -0.44673896 -0.11495633 -0.64281515 -0.46382477 -0.22227100 [61] -0.82627071 0.89629079 0.12621492 -0.52824020 -0.81387700 0.83762625 [67] 0.99866042 1.22877309 0.45193643 -0.24003340 -1.46138618 0.04197982 [73] 0.01610233 0.02270745 0.08358089 0.94089124 0.87703860 2.21792398 [79] 1.08129293 -1.17398672 -1.16284607 0.58281202 2.03582065 0.67174154 [85] 0.34439301 0.98585972 -0.52640509 -0.47903414 -0.22010427 0.24220657 [91] 1.25963054 0.78507475 1.53411279 0.83969048 -0.58457773 -1.36260428 [97] -1.56920360 -1.80106668 -0.75522655 0.22680105 > rowMin(tmp2) [1] 1.42917062 0.08138089 -0.17365722 0.68575342 -1.61345556 1.09107924 [7] 0.14787085 0.07495533 0.44544636 1.60981518 -1.66609306 0.42809257 [13] -1.80423552 0.38780294 0.56268335 -0.03682069 -0.66787510 0.91875822 [19] -0.18870060 0.77779176 0.48915387 0.99195631 0.02323207 -0.95671620 [25] -0.80824591 1.06762586 0.14019492 -1.44760258 -0.31078028 1.31485572 [31] 1.34759076 -1.33778530 0.99560160 -1.37664050 -0.29276732 -1.51305173 [37] 0.85654781 -1.49543015 -1.40588138 -1.32223018 -0.57521209 1.38550911 [43] 0.15953650 0.79742300 0.46932165 -0.44902067 -1.85612912 0.18562615 [49] -0.86013631 -0.11513006 -0.37810790 -0.67636521 0.69097536 -0.41746065 [55] 1.65578982 -0.44673896 -0.11495633 -0.64281515 -0.46382477 -0.22227100 [61] -0.82627071 0.89629079 0.12621492 -0.52824020 -0.81387700 0.83762625 [67] 0.99866042 1.22877309 0.45193643 -0.24003340 -1.46138618 0.04197982 [73] 0.01610233 0.02270745 0.08358089 0.94089124 0.87703860 2.21792398 [79] 1.08129293 -1.17398672 -1.16284607 0.58281202 2.03582065 0.67174154 [85] 0.34439301 0.98585972 -0.52640509 -0.47903414 -0.22010427 0.24220657 [91] 1.25963054 0.78507475 1.53411279 0.83969048 -0.58457773 -1.36260428 [97] -1.56920360 -1.80106668 -0.75522655 0.22680105 > > colMeans(tmp2) [1] 0.01399703 > colSums(tmp2) [1] 1.399703 > colVars(tmp2) [1] 0.9353576 > colSd(tmp2) [1] 0.9671389 > colMax(tmp2) [1] 2.217924 > colMin(tmp2) [1] -1.856129 > colMedians(tmp2) [1] 0.05846757 > colRanges(tmp2) [,1] [1,] -1.856129 [2,] 2.217924 > > 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.5429488 -1.7176984 -1.0746357 -1.9587858 -0.6903719 3.0645598 [7] 1.5961789 3.9206218 4.8034710 1.9500006 > colApply(tmp,quantile)[,1] [,1] [1,] -2.1187091 [2,] -0.5420922 [3,] -0.1383779 [4,] 0.5172782 [5,] 0.8671236 > > rowApply(tmp,sum) [1] 4.7151119 2.7802115 6.7926071 -0.3606699 3.7271433 -0.3454597 [7] -6.5452453 1.3216800 -2.5256069 -1.2093805 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 3 2 3 8 5 4 1 6 6 8 [2,] 1 3 7 5 8 7 8 1 8 4 [3,] 9 9 8 2 2 6 2 2 2 6 [4,] 5 7 6 1 9 5 3 9 7 2 [5,] 2 1 1 10 6 2 7 8 5 7 [6,] 6 4 2 4 10 10 6 10 4 5 [7,] 8 10 10 7 3 8 4 3 1 1 [8,] 7 5 4 3 7 1 10 5 10 9 [9,] 10 8 5 6 4 9 5 4 3 10 [10,] 4 6 9 9 1 3 9 7 9 3 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] -1.8058090 3.0424883 -0.8487772 -3.5350557 -0.0461506 0.4195169 [7] -0.3522785 -1.3510835 -0.7166384 1.6771073 0.4434795 0.3129062 [13] -2.3106456 0.4354388 -1.5464057 2.3696527 1.0009888 3.0422399 [19] 1.2016504 2.2725987 > colApply(tmp,quantile)[,1] [,1] [1,] -0.73223935 [2,] -0.59068881 [3,] -0.56209693 [4,] 0.02380063 [5,] 0.05541549 > > rowApply(tmp,sum) [1] 3.26661471 -0.06618916 2.49151679 1.47635306 -3.46307210 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 3 7 7 7 14 [2,] 11 19 11 13 16 [3,] 6 10 10 15 5 [4,] 2 1 6 12 6 [5,] 7 8 20 1 13 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.73223935 0.2554662 -0.2096868 -0.9627856 -0.09178905 1.9240495 [2,] -0.59068881 1.3246589 -0.1790999 -1.7363423 -0.53137251 -0.6060910 [3,] -0.56209693 0.2136387 -0.1725548 -0.5830169 2.81397489 -1.2165810 [4,] 0.05541549 0.4762652 0.5401092 0.4701332 -2.07990359 -0.6814066 [5,] 0.02380063 0.7724592 -0.8275450 -0.7230440 -0.15706033 0.9995461 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.03533758 1.0097662 -0.3255594 0.9856557 0.7044902 -0.5273702 [2,] -1.31035577 0.2468619 1.6145422 0.9292435 0.1922599 -0.2127631 [3,] -0.32592703 -1.3091175 -0.9252929 -0.8026133 0.2736469 0.4489718 [4,] 0.19172722 0.1811546 -0.6112718 -0.5425874 0.7091626 0.9108694 [5,] 1.05693949 -1.4797487 -0.4690564 1.1074089 -1.4360802 -0.3068017 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -1.6177036 0.5109618 0.6310919 -0.08534814 0.6002492 0.3247137 [2,] 1.1041921 -0.6095888 -0.9092576 0.02861883 -0.9290816 1.0080804 [3,] -1.0394252 0.3820493 0.6810221 1.68208109 0.6428980 1.6337113 [4,] 0.5263905 0.7313131 -1.0428474 1.21344178 0.2894037 0.5633788 [5,] -1.2840994 -0.5792965 -0.9064147 -0.46914084 0.3975194 -0.4876442 [,19] [,20] [1,] 0.7586213 0.07869341 [2,] 0.7940872 0.30590740 [3,] 0.9447976 -0.28864923 [4,] -0.7292700 0.30487506 [5,] -0.5665858 1.87177203 > > > 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 : 648 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 : 563 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -0.1886087 0.2524126 0.7878578 0.4703661 -0.3542807 0.7900571 -0.2577126 col8 col9 col10 col11 col12 col13 col14 row1 -0.6996702 1.019612 1.571613 -0.5348017 0.5936856 0.1034884 0.8543668 col15 col16 col17 col18 col19 col20 row1 -0.7214746 1.202069 0.1332691 1.059031 -0.167885 0.7203938 > tmp[,"col10"] col10 row1 1.5716126 row2 0.2178185 row3 2.2760880 row4 1.2762050 row5 0.2440979 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 -0.1886087 0.2524126 0.7878578 0.4703661 -0.3542807 0.7900571 row5 1.6454508 -0.6273242 -0.6958690 -0.9060388 0.4030277 -0.2138330 col7 col8 col9 col10 col11 col12 row1 -0.2577126 -0.69967022 1.0196115 1.5716126 -0.5348017 0.59368557 row5 0.2871145 -0.04311964 -0.6078977 0.2440979 -0.3741975 -0.02120024 col13 col14 col15 col16 col17 col18 col19 row1 0.1034884 0.8543668 -0.72147459 1.202069 0.1332691 1.0590315 -0.1678850 row5 -1.4050629 1.0871039 -0.06757192 -1.783752 -0.1186529 0.2429195 0.3610225 col20 row1 0.7203938 row5 0.6713772 > tmp[,c("col6","col20")] col6 col20 row1 0.7900571 0.7203938 row2 -0.4738279 -0.9306294 row3 1.9045064 1.7215794 row4 -0.2322921 0.5011467 row5 -0.2138330 0.6713772 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 0.7900571 0.7203938 row5 -0.2138330 0.6713772 > > > > > tmp["row1",] <- rnorm(20,mean=10) > tmp[,"col10"] <- rnorm(5,mean=30) > tmp[c("row1","row5"),] <- rnorm(40,mean=50) > tmp[,c("col6","col20")] <- rnorm(10,mean=75) > tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105) > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.76135 49.8911 48.99889 49.96961 49.33854 104.0423 50.52633 50.91503 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.05922 50.2329 49.42395 48.08744 49.8195 48.81754 50.67672 48.30958 col17 col18 col19 col20 row1 50.54773 49.88203 51.68349 104.0237 > tmp[,"col10"] col10 row1 50.23290 row2 30.04466 row3 30.34072 row4 29.72967 row5 50.65180 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.76135 49.89110 48.99889 49.96961 49.33854 104.0423 50.52633 50.91503 row5 49.53383 48.72548 50.11125 50.47868 49.75981 104.6306 50.17574 50.39418 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.05922 50.2329 49.42395 48.08744 49.81950 48.81754 50.67672 48.30958 row5 49.38262 50.6518 50.17311 50.82427 52.51892 48.17731 51.48482 49.59154 col17 col18 col19 col20 row1 50.54773 49.88203 51.68349 104.0237 row5 47.61127 48.67871 50.24374 104.1078 > tmp[,c("col6","col20")] col6 col20 row1 104.04225 104.02375 row2 73.36901 74.51430 row3 75.68683 74.76841 row4 76.78168 74.19070 row5 104.63062 104.10783 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 104.0423 104.0237 row5 104.6306 104.1078 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 104.0423 104.0237 row5 104.6306 104.1078 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] -1.05418891 [2,] -0.03147241 [3,] 1.06574742 [4,] 0.76717912 [5,] -0.64570380 > tmp[,c("col17","col7")] col17 col7 [1,] 0.8402374 0.38129883 [2,] -1.6160361 -0.32775652 [3,] -1.2014993 0.01065489 [4,] -0.4852172 -0.12557441 [5,] 0.7490832 0.13172178 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -1.203197326 -0.1862320 [2,] -0.699535854 -0.9441225 [3,] 0.895677113 1.4322955 [4,] 0.396545652 -1.1183036 [5,] 0.007952144 0.1094440 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -1.203197 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -1.2031973 [2,] -0.6995359 > > > > 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.71692454 -2.030735 -0.08296974 0.6524207 -0.8171001 1.9726702 row1 0.06746999 -2.073525 -1.71814393 -0.4090794 0.4503346 -0.5308154 [,7] [,8] [,9] [,10] [,11] [,12] row3 -0.2845147 -0.1053988 0.1691763 0.02865035 0.05307293 1.9099592 row1 0.1900088 -2.7119853 0.5206371 -0.50121234 0.26679531 0.8828756 [,13] [,14] [,15] [,16] [,17] [,18] row3 -0.0324393 1.0106019 0.6509532 -0.2307058 -0.7432413 -0.08300936 row1 1.4164714 0.7444402 -0.5308744 0.2814150 -0.6873495 0.22268630 [,19] [,20] row3 -0.03957798 -0.2116881 row1 -1.02441042 0.8818891 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.3019565 0.841512 1.774538 1.363715 1.674325 0.3508486 0.570744 [,8] [,9] [,10] row2 0.3725329 -0.3961617 -1.647042 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 1.448146 2.079456 1.025098 -0.1438963 0.50373 0.01920819 0.9576817 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -1.250861 1.620864 -0.3180564 0.3940345 -0.8603316 1.168925 -0.3986912 [,15] [,16] [,17] [,18] [,19] [,20] row5 0.6551383 -0.876624 -0.5144406 0.1343379 0.513265 -0.2187792 > > > 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: 0x600003098000> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd7cf5028e" [2] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd397af8b9" [3] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd385f572a" [4] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd7b53a34f" [5] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd3006d6ca" [6] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd10ff8068" [7] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd7647348f" [8] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd3ccbd4f3" [9] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd6a09bcb3" [10] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd2543c228" [11] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd37fe335" [12] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd411dae5e" [13] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd3a2beb8" [14] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd319723e5" [15] "/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1abd39b5a8d2" > > > ### 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: 0x6000030f80c0> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x6000030f80c0> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x6000030f80c0> > rowMedians(tmp) [1] 0.1929505436 -0.0926479094 -0.3936986906 0.5168699911 -0.1853378260 [6] -0.3607051494 -0.0909507455 -0.2395890077 0.6630796781 -0.5420351264 [11] 0.1377472682 -0.3247961959 0.0051980087 0.0862419954 0.3888938567 [16] 0.1058656568 0.7563487913 0.3897167802 -0.1798875118 0.3954243125 [21] 0.2051597030 -0.5631616063 -0.2421668458 0.1279198121 -0.0788890050 [26] 0.2489913666 0.5699632235 -0.3032245951 -0.2869036231 -0.0164248983 [31] 0.8456307467 0.5137741876 -0.4676964105 -0.0157168785 0.1301621184 [36] 0.2284046644 -0.7716921695 -0.5863737945 -0.1532924626 0.2189452440 [41] -0.9121521178 -0.0836781884 0.1272559083 -0.1179517356 -0.2550074894 [46] 0.2024187034 0.0091376339 0.1222486276 0.4505894711 0.1321238754 [51] 0.3321819120 -0.0240850278 0.1401088286 0.0535005047 -0.1811496253 [56] -0.0472110595 0.1396504143 0.1998114378 0.0374098308 0.1743606869 [61] -0.6014623587 0.0854091258 0.1561528210 0.0633224456 -0.2690385841 [66] -0.4967855347 -0.3136123284 -0.6994389120 -0.0807827434 0.2167613516 [71] -0.2961291260 -0.3484870881 0.0940116946 -0.2474830552 -0.2966926651 [76] 0.4562819004 0.2314798357 -0.1244664281 0.3117567160 -0.0003278875 [81] 0.2589972503 -0.3184746907 0.4110595288 0.1410526157 -0.1529501422 [86] -0.5586302237 -0.2968848044 0.6905508607 -0.0023601815 0.4218169823 [91] -0.4556352633 0.6692322059 -0.2100948823 0.1729469900 -0.0555137494 [96] -0.4485831895 -0.0184117773 -0.3084798510 0.1501577067 0.1318042525 [101] 0.2387625205 0.0838521857 -0.5160952436 0.0926955259 0.2276143886 [106] 0.3172004431 0.3145576592 -0.0521348087 0.0748775625 -0.1990042469 [111] -0.2510842400 0.0814706493 -0.1504994669 -0.0054264860 -0.1671597359 [116] -0.1339198862 -0.1751185285 0.3926729214 0.2283434601 0.1073395819 [121] 0.2384438377 -0.2195838933 0.2280728045 -0.1407008180 -0.2494782701 [126] 0.3801931252 -0.1885126286 0.6239685929 0.2915258058 0.5761241344 [131] 0.0432692919 0.3148229431 -0.2513619918 0.3383996668 0.2363937775 [136] -0.3163689578 -0.4023843795 0.2171164236 -0.4387830712 -0.1663321650 [141] -0.9918911139 0.5760659659 0.0166425414 -0.3589408619 0.7507623890 [146] 0.0175627576 0.1841069927 -0.0520835715 0.6287753196 -0.1204771471 [151] 0.0567001674 -0.0848730060 0.4215985651 -0.1481597145 0.3111772630 [156] 0.1259855575 -0.1586086562 -0.3103766573 -0.0083860051 -0.1881769288 [161] -0.1335904703 0.0342430504 0.3073690427 0.1545787600 -0.2236325458 [166] -0.1438727579 -0.1341955244 0.1633308341 -0.5565178617 0.3296495142 [171] -0.2897270641 -0.4819694796 -0.1566889014 0.7317724794 0.1169298410 [176] -0.2730508575 0.2351249320 -0.0300852380 -0.1334611688 -0.4278140171 [181] 0.1715491914 0.0881295218 0.2463200411 0.5763493872 -0.0286665365 [186] 0.1306997465 -0.3942348267 0.6229144818 -0.1928874497 -0.4006122519 [191] 0.0532644922 -0.6997220942 -0.1935206202 -0.5648246533 0.0865313667 [196] 0.3248478249 0.1026129507 -0.7761686738 0.0313407981 -0.0914258176 [201] 0.2490371988 -0.2377149485 0.1125386871 0.5052072314 0.0767386923 [206] -0.6467182054 0.2864261135 -0.3611053791 0.5446835810 -0.4334999587 [211] -0.2148813668 0.2211623687 0.3438799970 -0.1423382723 0.4564184106 [216] -0.1701429331 -0.2168420948 0.3620839262 -0.1635389706 -0.3564859629 [221] -0.2870944909 -0.4561566923 -0.1008610303 -0.2039150133 0.4290113349 [226] -0.1498223387 0.0584931236 -0.6484294479 -0.0173773246 -0.0196236442 > > proc.time() user system elapsed 2.615 15.003 18.364
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" Copyright (C) 2024 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: 0x6000004a4060> > .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: 0x6000004a4060> > .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: 0x6000004a4060> > .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: 0x6000004a4060> > 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: 0x6000004e8000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004e8000> > .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: 0x6000004e8000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004e8000> > .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: 0x6000004e8000> > 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: 0x600000488120> > .Call("R_bm_AddColumn",P) <pointer: 0x600000488120> > .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: 0x600000488120> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600000488120> > .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: 0x600000488120> > > .Call("R_bm_RowMode",P) <pointer: 0x600000488120> > .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: 0x600000488120> > > .Call("R_bm_ColMode",P) <pointer: 0x600000488120> > .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: 0x600000488120> > 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: 0x6000004f0000> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x6000004f0000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004f0000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004f0000> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile1d173808c072" "BufferedMatrixFile1d174692991b" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile1d173808c072" "BufferedMatrixFile1d174692991b" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x6000004ec120> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004ec120> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x6000004ec120> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x6000004ec120> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x6000004ec120> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x6000004ec120> > .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: 0x6000004fc000> > .Call("R_bm_AddColumn",P) <pointer: 0x6000004fc000> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x6000004fc000> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x6000004fc000> > 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: 0x6000004fc180> > .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: 0x6000004fc180> > rm(P) > > proc.time() user system elapsed 0.383 0.162 0.555
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2024-11-20 r87352) -- "Unsuffered Consequences" Copyright (C) 2024 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.333 0.086 0.415