Back to Multiple platform build/check report for BioC 3.20: simplified long |
|
This page was generated on 2024-07-23 11:42 -0400 (Tue, 23 Jul 2024).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo2 | Linux (Ubuntu 22.04.3 LTS) | x86_64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4688 |
palomino8 | Windows Server 2022 Datacenter | x64 | 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life" | 4280 |
lconway | macOS 12.7.1 Monterey | x86_64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4455 |
kjohnson3 | macOS 13.6.5 Ventura | arm64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4404 |
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 249/2248 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.69.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 22.04.3 LTS) / x86_64 | OK | OK | OK | ![]() | ||||||||
palomino8 | Windows Server 2022 Datacenter / x64 | OK | OK | OK | OK | ![]() | ||||||||
lconway | macOS 12.7.1 Monterey / x86_64 | OK | OK | WARNINGS | OK | ![]() | ||||||||
kjohnson3 | macOS 13.6.5 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.69.0 |
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.69.0.tar.gz |
StartedAt: 2024-07-22 20:19:12 -0400 (Mon, 22 Jul 2024) |
EndedAt: 2024-07-22 20:19:26 -0400 (Mon, 22 Jul 2024) |
EllapsedTime: 14.1 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.69.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.4.1 (2024-06-14) * using platform: aarch64-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 Ventura 13.6.7 * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.69.0’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘BufferedMatrix’ can be installed ... WARNING Found the following significant warnings: doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses] See ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details. * used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’ * used SDK: ‘MacOSX11.3.sdk’ * checking installed package size ... OK * checking package directory ... OK * checking ‘build’ directory ... OK * checking DESCRIPTION meta-information ... OK * checking top-level files ... OK * checking for left-over files ... OK * checking index information ... OK * checking package subdirectories ... OK * checking code files for non-ASCII characters ... OK * checking R files for syntax errors ... OK * checking whether the package can be loaded ... OK * checking whether the package can be loaded with stated dependencies ... OK * checking whether the package can be unloaded cleanly ... OK * checking whether the namespace can be loaded with stated dependencies ... OK * checking whether the namespace can be unloaded cleanly ... OK * checking dependencies in R code ... OK * checking S3 generic/method consistency ... OK * checking replacement functions ... OK * checking foreign function calls ... OK * checking R code for possible problems ... OK * checking Rd files ... NOTE checkRd: (-1) BufferedMatrix-class.Rd:209: Lost braces; missing escapes or markup? 209 | $x^{power}$ elementwise of the matrix | ^ prepare_Rd: createBufferedMatrix.Rd:26: Dropping empty section \keyword prepare_Rd: createBufferedMatrix.Rd:17-18: Dropping empty section \details prepare_Rd: createBufferedMatrix.Rd:15-16: Dropping empty section \value prepare_Rd: createBufferedMatrix.Rd:19-20: Dropping empty section \references prepare_Rd: createBufferedMatrix.Rd:21-22: Dropping empty section \seealso prepare_Rd: createBufferedMatrix.Rd:23-24: Dropping empty section \examples * checking Rd metadata ... OK * checking Rd cross-references ... OK * checking for missing documentation entries ... OK * checking for code/documentation mismatches ... OK * checking Rd \usage sections ... OK * checking Rd contents ... OK * checking for unstated dependencies in examples ... OK * checking line endings in C/C++/Fortran sources/headers ... OK * checking compiled code ... NOTE Note: information on .o files is not available * checking sizes of PDF files under ‘inst/doc’ ... OK * checking files in ‘vignettes’ ... OK * checking examples ... NONE * checking for unstated dependencies in ‘tests’ ... OK * checking tests ... Running ‘Rcodetesting.R’ Running ‘c_code_level_tests.R’ Running ‘objectTesting.R’ Running ‘rawCalltesting.R’ OK * checking for unstated dependencies in vignettes ... OK * checking package vignettes ... OK * checking running R code from vignettes ... SKIPPED * checking re-building of vignette outputs ... SKIPPED * checking PDF version of manual ... OK * DONE Status: 1 WARNING, 2 NOTEs See ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library ‘/Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library’ * installing *source* package ‘BufferedMatrix’ ... ** using staged installation ** libs using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’ using SDK: ‘MacOSX11.3.sdk’ clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/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 arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o clang -arch arm64 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o clang -arch arm64 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation installing to /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs ** R ** inst ** byte-compile and prepare package for lazy loading Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’ Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’ Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’ ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-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.109 0.031 0.136
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-apple-darwin20 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths()); Attaching package: 'BufferedMatrix' The following objects are masked from 'package:base': colMeans, colSums, rowMeans, rowSums > > > ### this is used to control how many repetitions in something below > ### higher values result in more checks. > nreps <-100 ##20000 > > > ## test creation and some simple assignments and subsetting operations > > ## first on single elements > tmp <- createBufferedMatrix(1000,10) > > tmp[10,5] [1] 0 > tmp[10,5] <- 10 > tmp[10,5] [1] 10 > tmp[10,5] <- 12.445 > tmp[10,5] [1] 12.445 > > > > ## now testing accessing multiple elements > tmp2 <- createBufferedMatrix(10,20) > > > tmp2[3,1] <- 51.34 > tmp2[9,2] <- 9.87654 > tmp2[,1:2] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[,-(3:20)] [,1] [,2] [1,] 0.00 0.00000 [2,] 0.00 0.00000 [3,] 51.34 0.00000 [4,] 0.00 0.00000 [5,] 0.00 0.00000 [6,] 0.00 0.00000 [7,] 0.00 0.00000 [8,] 0.00 0.00000 [9,] 0.00 9.87654 [10,] 0.00 0.00000 > tmp2[3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 51.34 0 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 > tmp2[-3,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [1,] 0 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 0 > tmp2[2,1:3] [,1] [,2] [,3] [1,] 0 0 0 > tmp2[3:9,1:3] [,1] [,2] [,3] [1,] 51.34 0.00000 0 [2,] 0.00 0.00000 0 [3,] 0.00 0.00000 0 [4,] 0.00 0.00000 0 [5,] 0.00 0.00000 0 [6,] 0.00 0.00000 0 [7,] 0.00 9.87654 0 > tmp2[-4,-4] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [2,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [3,] 51.34 0.00000 0 0 0 0 0 0 0 0 0 0 0 [4,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [5,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [6,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [7,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [8,] 0.00 9.87654 0 0 0 0 0 0 0 0 0 0 0 [9,] 0.00 0.00000 0 0 0 0 0 0 0 0 0 0 0 [,14] [,15] [,16] [,17] [,18] [,19] [1,] 0 0 0 0 0 0 [2,] 0 0 0 0 0 0 [3,] 0 0 0 0 0 0 [4,] 0 0 0 0 0 0 [5,] 0 0 0 0 0 0 [6,] 0 0 0 0 0 0 [7,] 0 0 0 0 0 0 [8,] 0 0 0 0 0 0 [9,] 0 0 0 0 0 0 > > ## now testing accessing/assigning multiple elements > tmp3 <- createBufferedMatrix(10,10) > > for (i in 1:10){ + for (j in 1:10){ + tmp3[i,j] <- (j-1)*10 + i + } + } > > tmp3[2:4,2:4] [,1] [,2] [,3] [1,] 12 22 32 [2,] 13 23 33 [3,] 14 24 34 > tmp3[c(-10),c(2:4,2:4,10,1,2,1:10,10:1)] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [1,] 11 21 31 11 21 31 91 1 11 1 11 21 31 [2,] 12 22 32 12 22 32 92 2 12 2 12 22 32 [3,] 13 23 33 13 23 33 93 3 13 3 13 23 33 [4,] 14 24 34 14 24 34 94 4 14 4 14 24 34 [5,] 15 25 35 15 25 35 95 5 15 5 15 25 35 [6,] 16 26 36 16 26 36 96 6 16 6 16 26 36 [7,] 17 27 37 17 27 37 97 7 17 7 17 27 37 [8,] 18 28 38 18 28 38 98 8 18 8 18 28 38 [9,] 19 29 39 19 29 39 99 9 19 9 19 29 39 [,14] [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [1,] 41 51 61 71 81 91 91 81 71 61 51 41 [2,] 42 52 62 72 82 92 92 82 72 62 52 42 [3,] 43 53 63 73 83 93 93 83 73 63 53 43 [4,] 44 54 64 74 84 94 94 84 74 64 54 44 [5,] 45 55 65 75 85 95 95 85 75 65 55 45 [6,] 46 56 66 76 86 96 96 86 76 66 56 46 [7,] 47 57 67 77 87 97 97 87 77 67 57 47 [8,] 48 58 68 78 88 98 98 88 78 68 58 48 [9,] 49 59 69 79 89 99 99 89 79 69 59 49 [,26] [,27] [,28] [,29] [1,] 31 21 11 1 [2,] 32 22 12 2 [3,] 33 23 13 3 [4,] 34 24 14 4 [5,] 35 25 15 5 [6,] 36 26 16 6 [7,] 37 27 17 7 [8,] 38 28 18 8 [9,] 39 29 19 9 > tmp3[-c(1:5),-c(6:10)] [,1] [,2] [,3] [,4] [,5] [1,] 6 16 26 36 46 [2,] 7 17 27 37 47 [3,] 8 18 28 38 48 [4,] 9 19 29 39 49 [5,] 10 20 30 40 50 > > ## assignment of whole columns > tmp3[,1] <- c(1:10*100.0) > tmp3[,1:2] <- tmp3[,1:2]*100 > tmp3[,1:2] <- tmp3[,2:1] > tmp3[,1:2] [,1] [,2] [1,] 1100 1e+04 [2,] 1200 2e+04 [3,] 1300 3e+04 [4,] 1400 4e+04 [5,] 1500 5e+04 [6,] 1600 6e+04 [7,] 1700 7e+04 [8,] 1800 8e+04 [9,] 1900 9e+04 [10,] 2000 1e+05 > > > tmp3[,-1] <- tmp3[,1:9] > tmp3[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1100 1100 1e+04 21 31 41 51 61 71 81 [2,] 1200 1200 2e+04 22 32 42 52 62 72 82 [3,] 1300 1300 3e+04 23 33 43 53 63 73 83 [4,] 1400 1400 4e+04 24 34 44 54 64 74 84 [5,] 1500 1500 5e+04 25 35 45 55 65 75 85 [6,] 1600 1600 6e+04 26 36 46 56 66 76 86 [7,] 1700 1700 7e+04 27 37 47 57 67 77 87 [8,] 1800 1800 8e+04 28 38 48 58 68 78 88 [9,] 1900 1900 9e+04 29 39 49 59 69 79 89 [10,] 2000 2000 1e+05 30 40 50 60 70 80 90 > > tmp3[,1:2] <- rep(1,10) > tmp3[,1:2] <- rep(1,20) > tmp3[,1:2] <- matrix(c(1:5),1,5) > > tmp3[,-c(1:8)] <- matrix(c(1:5),1,5) > > tmp3[1,] <- 1:10 > tmp3[1,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 > tmp3[-1,] <- c(1,2) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 2 1 2 1 2 1 2 1 2 1 [10,] 1 2 1 2 1 2 1 2 1 2 > tmp3[-c(1:8),] <- matrix(c(1:5),1,5) > tmp3[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 2 3 4 5 6 7 8 9 10 [2,] 1 2 1 2 1 2 1 2 1 2 [3,] 2 1 2 1 2 1 2 1 2 1 [4,] 1 2 1 2 1 2 1 2 1 2 [5,] 2 1 2 1 2 1 2 1 2 1 [6,] 1 2 1 2 1 2 1 2 1 2 [7,] 2 1 2 1 2 1 2 1 2 1 [8,] 1 2 1 2 1 2 1 2 1 2 [9,] 1 3 5 2 4 1 3 5 2 4 [10,] 2 4 1 3 5 2 4 1 3 5 > > > tmp3[1:2,1:2] <- 5555.04 > tmp3[-(1:2),1:2] <- 1234.56789 > > > > ## testing accessors for the directory and prefix > directory(tmp3) [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests" > prefix(tmp3) [1] "BM" > > ## testing if we can remove these objects > rm(tmp, tmp2, tmp3) > gc() used (Mb) gc trigger (Mb) limit (Mb) max used (Mb) Ncells 474153 25.4 1035435 55.3 NA 638574 34.2 Vcells 877599 6.7 8388608 64.0 196608 2072372 15.9 > > > > > ## > ## checking reads > ## > > tmp2 <- createBufferedMatrix(10,20) > > test.sample <- rnorm(10*20) > > tmp2[1:10,1:20] <- test.sample > > test.matrix <- matrix(test.sample,10,20) > > ## testing reads > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Mon Jul 22 20:19:20 2024" > 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 Jul 22 20:19:20 2024" > > > 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: 0x600001498000> > > > > 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 Jul 22 20:19:21 2024" > 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 Jul 22 20:19:21 2024" > > ColMode(tmp2) <pointer: 0x600001498000> > > > > ### 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.84422473 -0.5906120 -0.5762876 -0.5359289 [2,] -0.49248340 -1.0400524 0.7330530 0.8891191 [3,] 0.17382351 -0.7944162 -0.7934822 0.4789669 [4,] 0.07255306 -0.2368581 -0.1388619 1.0009686 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 100.84422473 0.5906120 0.5762876 0.5359289 [2,] 0.49248340 1.0400524 0.7330530 0.8891191 [3,] 0.17382351 0.7944162 0.7934822 0.4789669 [4,] 0.07255306 0.2368581 0.1388619 1.0009686 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 10.0421225 0.7685129 0.7591361 0.7320717 [2,] 0.7017716 1.0198296 0.8561852 0.9429311 [3,] 0.4169215 0.8913003 0.8907762 0.6920743 [4,] 0.2693568 0.4866807 0.3726418 1.0004842 > > my.function <- function(x,power){ + (x+5)^power + } > > ewApply(tmp5,my.function,power=2) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 226.26545 33.27574 33.16765 32.85665 [2,] 32.51020 36.23835 34.29490 35.31843 [3,] 29.34304 34.70742 34.70124 32.39971 [4,] 27.76612 30.10366 28.86528 36.00581 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x60000149c000> > exp(tmp5) <pointer: 0x60000149c000> > log(tmp5,2) <pointer: 0x60000149c000> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 470.9419 > Min(tmp5) [1] 52.51931 > mean(tmp5) [1] 71.76016 > Sum(tmp5) [1] 14352.03 > Var(tmp5) [1] 869.3932 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 92.79964 69.78487 72.18422 66.82798 69.48197 68.03690 66.93731 70.63274 [9] 69.66663 71.24928 > rowSums(tmp5) [1] 1855.993 1395.697 1443.684 1336.560 1389.639 1360.738 1338.746 1412.655 [9] 1393.333 1424.986 > rowVars(tmp5) [1] 8003.02361 67.21268 72.75864 72.77855 50.30480 49.48104 [7] 52.07522 70.45634 64.65578 56.37626 > rowSd(tmp5) [1] 89.459620 8.198334 8.529867 8.531035 7.092587 7.034276 7.216316 [8] 8.393827 8.040882 7.508413 > rowMax(tmp5) [1] 470.94189 86.52805 85.60213 83.71280 83.69316 85.45031 81.07259 [8] 84.24661 87.41113 85.00597 > rowMin(tmp5) [1] 57.62565 53.65272 59.14752 55.90942 53.24889 57.97488 54.76179 52.51931 [9] 56.86829 60.09106 > > colMeans(tmp5) [1] 105.04497 67.49379 67.62930 68.09920 69.96197 68.23233 71.48450 [8] 67.52062 70.41011 72.11400 69.70916 69.10511 67.69365 68.75471 [15] 70.72567 71.00647 70.69685 70.83744 71.98004 76.70323 > colSums(tmp5) [1] 1050.4497 674.9379 676.2930 680.9920 699.6197 682.3233 714.8450 [8] 675.2062 704.1011 721.1400 697.0916 691.0511 676.9365 687.5471 [15] 707.2567 710.0647 706.9685 708.3744 719.8004 767.0323 > colVars(tmp5) [1] 16559.33257 23.59470 48.90673 53.58212 50.08264 59.73959 [7] 90.84540 92.50548 67.48630 65.77028 57.92238 67.43277 [13] 118.25050 52.23021 51.58066 49.49923 70.94122 77.29972 [19] 125.90032 43.51180 > colSd(tmp5) [1] 128.683070 4.857437 6.993335 7.319981 7.076909 7.729139 [7] 9.531286 9.617977 8.215004 8.109888 7.610675 8.211746 [13] 10.874304 7.227047 7.181968 7.035569 8.422661 8.792026 [19] 11.220531 6.596348 > colMax(tmp5) [1] 470.94189 75.42537 80.17293 79.33318 78.62264 84.87142 87.41113 [8] 85.00597 82.36893 85.45031 77.13503 81.07848 81.51848 84.24661 [15] 83.56670 82.48864 86.52805 89.24746 93.55939 83.71280 > colMin(tmp5) [1] 57.79154 59.02663 57.97488 56.86829 59.60364 57.62565 57.93597 52.51931 [9] 58.30764 63.33476 55.99267 57.85375 53.65272 59.14752 55.90942 58.80252 [17] 59.36649 57.66793 53.24889 63.77991 > > > ### 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.79964 69.78487 72.18422 66.82798 69.48197 NA 66.93731 70.63274 [9] 69.66663 71.24928 > rowSums(tmp5) [1] 1855.993 1395.697 1443.684 1336.560 1389.639 NA 1338.746 1412.655 [9] 1393.333 1424.986 > rowVars(tmp5) [1] 8003.02361 67.21268 72.75864 72.77855 50.30480 50.00669 [7] 52.07522 70.45634 64.65578 56.37626 > rowSd(tmp5) [1] 89.459620 8.198334 8.529867 8.531035 7.092587 7.071541 7.216316 [8] 8.393827 8.040882 7.508413 > rowMax(tmp5) [1] 470.94189 86.52805 85.60213 83.71280 83.69316 NA 81.07259 [8] 84.24661 87.41113 85.00597 > rowMin(tmp5) [1] 57.62565 53.65272 59.14752 55.90942 53.24889 NA 54.76179 52.51931 [9] 56.86829 60.09106 > > colMeans(tmp5) [1] 105.04497 67.49379 67.62930 68.09920 NA 68.23233 71.48450 [8] 67.52062 70.41011 72.11400 69.70916 69.10511 67.69365 68.75471 [15] 70.72567 71.00647 70.69685 70.83744 71.98004 76.70323 > colSums(tmp5) [1] 1050.4497 674.9379 676.2930 680.9920 NA 682.3233 714.8450 [8] 675.2062 704.1011 721.1400 697.0916 691.0511 676.9365 687.5471 [15] 707.2567 710.0647 706.9685 708.3744 719.8004 767.0323 > colVars(tmp5) [1] 16559.33257 23.59470 48.90673 53.58212 NA 59.73959 [7] 90.84540 92.50548 67.48630 65.77028 57.92238 67.43277 [13] 118.25050 52.23021 51.58066 49.49923 70.94122 77.29972 [19] 125.90032 43.51180 > colSd(tmp5) [1] 128.683070 4.857437 6.993335 7.319981 NA 7.729139 [7] 9.531286 9.617977 8.215004 8.109888 7.610675 8.211746 [13] 10.874304 7.227047 7.181968 7.035569 8.422661 8.792026 [19] 11.220531 6.596348 > colMax(tmp5) [1] 470.94189 75.42537 80.17293 79.33318 NA 84.87142 87.41113 [8] 85.00597 82.36893 85.45031 77.13503 81.07848 81.51848 84.24661 [15] 83.56670 82.48864 86.52805 89.24746 93.55939 83.71280 > colMin(tmp5) [1] 57.79154 59.02663 57.97488 56.86829 NA 57.62565 57.93597 52.51931 [9] 58.30764 63.33476 55.99267 57.85375 53.65272 59.14752 55.90942 58.80252 [17] 59.36649 57.66793 53.24889 63.77991 > > Max(tmp5,na.rm=TRUE) [1] 470.9419 > Min(tmp5,na.rm=TRUE) [1] 52.51931 > mean(tmp5,na.rm=TRUE) [1] 71.80985 > Sum(tmp5,na.rm=TRUE) [1] 14290.16 > Var(tmp5,na.rm=TRUE) [1] 873.2877 > > rowMeans(tmp5,na.rm=TRUE) [1] 92.79964 69.78487 72.18422 66.82798 69.48197 68.36143 66.93731 70.63274 [9] 69.66663 71.24928 > rowSums(tmp5,na.rm=TRUE) [1] 1855.993 1395.697 1443.684 1336.560 1389.639 1298.867 1338.746 1412.655 [9] 1393.333 1424.986 > rowVars(tmp5,na.rm=TRUE) [1] 8003.02361 67.21268 72.75864 72.77855 50.30480 50.00669 [7] 52.07522 70.45634 64.65578 56.37626 > rowSd(tmp5,na.rm=TRUE) [1] 89.459620 8.198334 8.529867 8.531035 7.092587 7.071541 7.216316 [8] 8.393827 8.040882 7.508413 > rowMax(tmp5,na.rm=TRUE) [1] 470.94189 86.52805 85.60213 83.71280 83.69316 85.45031 81.07259 [8] 84.24661 87.41113 85.00597 > rowMin(tmp5,na.rm=TRUE) [1] 57.62565 53.65272 59.14752 55.90942 53.24889 57.97488 54.76179 52.51931 [9] 56.86829 60.09106 > > colMeans(tmp5,na.rm=TRUE) [1] 105.04497 67.49379 67.62930 68.09920 70.86096 68.23233 71.48450 [8] 67.52062 70.41011 72.11400 69.70916 69.10511 67.69365 68.75471 [15] 70.72567 71.00647 70.69685 70.83744 71.98004 76.70323 > colSums(tmp5,na.rm=TRUE) [1] 1050.4497 674.9379 676.2930 680.9920 637.7487 682.3233 714.8450 [8] 675.2062 704.1011 721.1400 697.0916 691.0511 676.9365 687.5471 [15] 707.2567 710.0647 706.9685 708.3744 719.8004 767.0323 > colVars(tmp5,na.rm=TRUE) [1] 16559.33257 23.59470 48.90673 53.58212 47.25078 59.73959 [7] 90.84540 92.50548 67.48630 65.77028 57.92238 67.43277 [13] 118.25050 52.23021 51.58066 49.49923 70.94122 77.29972 [19] 125.90032 43.51180 > colSd(tmp5,na.rm=TRUE) [1] 128.683070 4.857437 6.993335 7.319981 6.873920 7.729139 [7] 9.531286 9.617977 8.215004 8.109888 7.610675 8.211746 [13] 10.874304 7.227047 7.181968 7.035569 8.422661 8.792026 [19] 11.220531 6.596348 > colMax(tmp5,na.rm=TRUE) [1] 470.94189 75.42537 80.17293 79.33318 78.62264 84.87142 87.41113 [8] 85.00597 82.36893 85.45031 77.13503 81.07848 81.51848 84.24661 [15] 83.56670 82.48864 86.52805 89.24746 93.55939 83.71280 > colMin(tmp5,na.rm=TRUE) [1] 57.79154 59.02663 57.97488 56.86829 59.60364 57.62565 57.93597 52.51931 [9] 58.30764 63.33476 55.99267 57.85375 53.65272 59.14752 55.90942 58.80252 [17] 59.36649 57.66793 53.24889 63.77991 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 92.79964 69.78487 72.18422 66.82798 69.48197 NaN 66.93731 70.63274 [9] 69.66663 71.24928 > rowSums(tmp5,na.rm=TRUE) [1] 1855.993 1395.697 1443.684 1336.560 1389.639 0.000 1338.746 1412.655 [9] 1393.333 1424.986 > rowVars(tmp5,na.rm=TRUE) [1] 8003.02361 67.21268 72.75864 72.77855 50.30480 NA [7] 52.07522 70.45634 64.65578 56.37626 > rowSd(tmp5,na.rm=TRUE) [1] 89.459620 8.198334 8.529867 8.531035 7.092587 NA 7.216316 [8] 8.393827 8.040882 7.508413 > rowMax(tmp5,na.rm=TRUE) [1] 470.94189 86.52805 85.60213 83.71280 83.69316 NA 81.07259 [8] 84.24661 87.41113 85.00597 > rowMin(tmp5,na.rm=TRUE) [1] 57.62565 53.65272 59.14752 55.90942 53.24889 NA 54.76179 52.51931 [9] 56.86829 60.09106 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 110.00118 67.43244 68.70201 68.93535 NaN 68.19942 72.28099 [8] 66.71454 70.89416 70.63219 69.54947 70.10542 66.15755 68.61563 [15] 70.88448 70.86990 70.70416 71.58149 72.21650 78.13916 > colSums(tmp5,na.rm=TRUE) [1] 990.0106 606.8920 618.3181 620.4182 0.0000 613.7947 650.5289 600.4309 [9] 638.0475 635.6897 625.9452 630.9488 595.4180 617.5406 637.9603 637.8291 [17] 636.3375 644.2335 649.9485 703.2524 > colVars(tmp5,na.rm=TRUE) [1] 18352.90402 26.50170 42.07455 52.41441 NA 67.19485 [7] 95.06406 96.75883 73.28608 49.28921 64.87577 64.60480 [13] 106.48652 58.54135 57.74454 55.47679 79.80827 80.73404 [19] 141.00883 25.75464 > colSd(tmp5,na.rm=TRUE) [1] 135.472890 5.147980 6.486489 7.239780 NA 8.197246 [7] 9.750080 9.836606 8.560729 7.020627 8.054550 8.037711 [13] 10.319231 7.651232 7.598983 7.448275 8.933547 8.985212 [19] 11.874714 5.074903 > colMax(tmp5,na.rm=TRUE) [1] 470.94189 75.42537 80.17293 79.33318 -Inf 84.87142 87.41113 [8] 85.00597 82.36893 79.73247 77.13503 81.07848 80.31424 84.24661 [15] 83.56670 82.48864 86.52805 89.24746 93.55939 83.71280 > colMin(tmp5,na.rm=TRUE) [1] 57.79154 59.02663 60.07930 56.86829 Inf 57.62565 57.93597 52.51931 [9] 58.30764 63.33476 55.99267 57.85375 53.65272 59.14752 55.90942 58.80252 [17] 59.36649 57.66793 53.24889 67.87868 > > > > > 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] 125.7604 307.8257 221.7222 305.2434 251.4207 165.7671 234.5033 248.6374 [9] 289.8786 309.6762 > apply(copymatrix,1,var,na.rm=TRUE) [1] 125.7604 307.8257 221.7222 305.2434 251.4207 165.7671 234.5033 248.6374 [9] 289.8786 309.6762 > > > > 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] -7.105427e-15 -5.684342e-14 2.273737e-13 -7.105427e-14 -1.278977e-13 [6] -2.842171e-14 2.273737e-13 -1.136868e-13 -1.705303e-13 -1.776357e-14 [11] 5.684342e-14 1.705303e-13 5.684342e-14 5.684342e-14 0.000000e+00 [16] -1.705303e-13 0.000000e+00 -2.842171e-14 1.705303e-13 -1.136868e-13 > > > > > > > > > > > ## 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) + } 10 3 8 12 3 14 1 6 6 14 6 20 3 12 10 3 10 8 7 11 7 19 8 7 9 3 3 19 5 19 6 14 2 11 3 7 3 20 4 3 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.454443 > Min(tmp) [1] -3.547045 > mean(tmp) [1] 0.05301477 > Sum(tmp) [1] 5.301477 > Var(tmp) [1] 1.102644 > > rowMeans(tmp) [1] 0.05301477 > rowSums(tmp) [1] 5.301477 > rowVars(tmp) [1] 1.102644 > rowSd(tmp) [1] 1.050069 > rowMax(tmp) [1] 2.454443 > rowMin(tmp) [1] -3.547045 > > colMeans(tmp) [1] 0.2712895713 -0.9277452843 0.4596121564 1.2375548770 1.6466543540 [6] 1.0352674473 1.0723399146 -0.3486596398 -1.9982726751 0.9465405197 [11] 0.5312701883 -0.9517280029 1.3214304965 0.5968085490 0.6660486764 [16] 0.8680301179 -0.6353166269 1.5960175964 0.3986035433 0.6613750700 [21] -1.9463844362 -0.5900317939 0.7079321961 -1.3808943156 -0.1719030459 [26] -0.2748003299 0.1038972546 -0.7016027584 -1.6004386281 0.3471654039 [31] -0.0472666334 0.4095278982 0.0190759619 0.0669455577 -1.3795368109 [36] 0.8908364724 0.0291988748 0.2845636288 0.2088650224 -0.9592825689 [41] -0.4250607545 -0.3747334348 -0.7054620058 -0.7370065581 -0.0009426421 [46] -0.7139733702 0.2761348306 -0.3368920050 -1.5918108743 0.5993105814 [51] -0.5865257372 -3.5470450191 1.3376212807 -0.0549558376 -0.7531938484 [56] 0.4506249901 0.3814741522 -0.7950022471 -2.0191038382 0.0176070758 [61] -0.9604922017 1.2457472260 -0.0893660489 -1.4076496252 0.3223003679 [66] 1.0259293836 -0.8644015324 0.1035453489 0.4733167244 1.2568605816 [71] -1.1172045658 0.9830326534 1.8951772117 0.1284199068 1.8331653575 [76] 1.0690987584 -0.4947246086 1.1750864383 -1.2671835248 1.4699203883 [81] 0.8259162783 0.9712007122 1.4296660090 0.5258449430 0.2753403165 [86] -0.4388660603 -0.5261799026 2.4544428350 -1.2148287261 -2.0361054258 [91] -0.2399285861 0.6389940453 -1.3966220096 0.5302581512 0.5082996118 [96] -0.1536872558 -0.7199670885 1.5323178758 0.9554150651 1.7153353663 > colSums(tmp) [1] 0.2712895713 -0.9277452843 0.4596121564 1.2375548770 1.6466543540 [6] 1.0352674473 1.0723399146 -0.3486596398 -1.9982726751 0.9465405197 [11] 0.5312701883 -0.9517280029 1.3214304965 0.5968085490 0.6660486764 [16] 0.8680301179 -0.6353166269 1.5960175964 0.3986035433 0.6613750700 [21] -1.9463844362 -0.5900317939 0.7079321961 -1.3808943156 -0.1719030459 [26] -0.2748003299 0.1038972546 -0.7016027584 -1.6004386281 0.3471654039 [31] -0.0472666334 0.4095278982 0.0190759619 0.0669455577 -1.3795368109 [36] 0.8908364724 0.0291988748 0.2845636288 0.2088650224 -0.9592825689 [41] -0.4250607545 -0.3747334348 -0.7054620058 -0.7370065581 -0.0009426421 [46] -0.7139733702 0.2761348306 -0.3368920050 -1.5918108743 0.5993105814 [51] -0.5865257372 -3.5470450191 1.3376212807 -0.0549558376 -0.7531938484 [56] 0.4506249901 0.3814741522 -0.7950022471 -2.0191038382 0.0176070758 [61] -0.9604922017 1.2457472260 -0.0893660489 -1.4076496252 0.3223003679 [66] 1.0259293836 -0.8644015324 0.1035453489 0.4733167244 1.2568605816 [71] -1.1172045658 0.9830326534 1.8951772117 0.1284199068 1.8331653575 [76] 1.0690987584 -0.4947246086 1.1750864383 -1.2671835248 1.4699203883 [81] 0.8259162783 0.9712007122 1.4296660090 0.5258449430 0.2753403165 [86] -0.4388660603 -0.5261799026 2.4544428350 -1.2148287261 -2.0361054258 [91] -0.2399285861 0.6389940453 -1.3966220096 0.5302581512 0.5082996118 [96] -0.1536872558 -0.7199670885 1.5323178758 0.9554150651 1.7153353663 > 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.2712895713 -0.9277452843 0.4596121564 1.2375548770 1.6466543540 [6] 1.0352674473 1.0723399146 -0.3486596398 -1.9982726751 0.9465405197 [11] 0.5312701883 -0.9517280029 1.3214304965 0.5968085490 0.6660486764 [16] 0.8680301179 -0.6353166269 1.5960175964 0.3986035433 0.6613750700 [21] -1.9463844362 -0.5900317939 0.7079321961 -1.3808943156 -0.1719030459 [26] -0.2748003299 0.1038972546 -0.7016027584 -1.6004386281 0.3471654039 [31] -0.0472666334 0.4095278982 0.0190759619 0.0669455577 -1.3795368109 [36] 0.8908364724 0.0291988748 0.2845636288 0.2088650224 -0.9592825689 [41] -0.4250607545 -0.3747334348 -0.7054620058 -0.7370065581 -0.0009426421 [46] -0.7139733702 0.2761348306 -0.3368920050 -1.5918108743 0.5993105814 [51] -0.5865257372 -3.5470450191 1.3376212807 -0.0549558376 -0.7531938484 [56] 0.4506249901 0.3814741522 -0.7950022471 -2.0191038382 0.0176070758 [61] -0.9604922017 1.2457472260 -0.0893660489 -1.4076496252 0.3223003679 [66] 1.0259293836 -0.8644015324 0.1035453489 0.4733167244 1.2568605816 [71] -1.1172045658 0.9830326534 1.8951772117 0.1284199068 1.8331653575 [76] 1.0690987584 -0.4947246086 1.1750864383 -1.2671835248 1.4699203883 [81] 0.8259162783 0.9712007122 1.4296660090 0.5258449430 0.2753403165 [86] -0.4388660603 -0.5261799026 2.4544428350 -1.2148287261 -2.0361054258 [91] -0.2399285861 0.6389940453 -1.3966220096 0.5302581512 0.5082996118 [96] -0.1536872558 -0.7199670885 1.5323178758 0.9554150651 1.7153353663 > colMin(tmp) [1] 0.2712895713 -0.9277452843 0.4596121564 1.2375548770 1.6466543540 [6] 1.0352674473 1.0723399146 -0.3486596398 -1.9982726751 0.9465405197 [11] 0.5312701883 -0.9517280029 1.3214304965 0.5968085490 0.6660486764 [16] 0.8680301179 -0.6353166269 1.5960175964 0.3986035433 0.6613750700 [21] -1.9463844362 -0.5900317939 0.7079321961 -1.3808943156 -0.1719030459 [26] -0.2748003299 0.1038972546 -0.7016027584 -1.6004386281 0.3471654039 [31] -0.0472666334 0.4095278982 0.0190759619 0.0669455577 -1.3795368109 [36] 0.8908364724 0.0291988748 0.2845636288 0.2088650224 -0.9592825689 [41] -0.4250607545 -0.3747334348 -0.7054620058 -0.7370065581 -0.0009426421 [46] -0.7139733702 0.2761348306 -0.3368920050 -1.5918108743 0.5993105814 [51] -0.5865257372 -3.5470450191 1.3376212807 -0.0549558376 -0.7531938484 [56] 0.4506249901 0.3814741522 -0.7950022471 -2.0191038382 0.0176070758 [61] -0.9604922017 1.2457472260 -0.0893660489 -1.4076496252 0.3223003679 [66] 1.0259293836 -0.8644015324 0.1035453489 0.4733167244 1.2568605816 [71] -1.1172045658 0.9830326534 1.8951772117 0.1284199068 1.8331653575 [76] 1.0690987584 -0.4947246086 1.1750864383 -1.2671835248 1.4699203883 [81] 0.8259162783 0.9712007122 1.4296660090 0.5258449430 0.2753403165 [86] -0.4388660603 -0.5261799026 2.4544428350 -1.2148287261 -2.0361054258 [91] -0.2399285861 0.6389940453 -1.3966220096 0.5302581512 0.5082996118 [96] -0.1536872558 -0.7199670885 1.5323178758 0.9554150651 1.7153353663 > colMedians(tmp) [1] 0.2712895713 -0.9277452843 0.4596121564 1.2375548770 1.6466543540 [6] 1.0352674473 1.0723399146 -0.3486596398 -1.9982726751 0.9465405197 [11] 0.5312701883 -0.9517280029 1.3214304965 0.5968085490 0.6660486764 [16] 0.8680301179 -0.6353166269 1.5960175964 0.3986035433 0.6613750700 [21] -1.9463844362 -0.5900317939 0.7079321961 -1.3808943156 -0.1719030459 [26] -0.2748003299 0.1038972546 -0.7016027584 -1.6004386281 0.3471654039 [31] -0.0472666334 0.4095278982 0.0190759619 0.0669455577 -1.3795368109 [36] 0.8908364724 0.0291988748 0.2845636288 0.2088650224 -0.9592825689 [41] -0.4250607545 -0.3747334348 -0.7054620058 -0.7370065581 -0.0009426421 [46] -0.7139733702 0.2761348306 -0.3368920050 -1.5918108743 0.5993105814 [51] -0.5865257372 -3.5470450191 1.3376212807 -0.0549558376 -0.7531938484 [56] 0.4506249901 0.3814741522 -0.7950022471 -2.0191038382 0.0176070758 [61] -0.9604922017 1.2457472260 -0.0893660489 -1.4076496252 0.3223003679 [66] 1.0259293836 -0.8644015324 0.1035453489 0.4733167244 1.2568605816 [71] -1.1172045658 0.9830326534 1.8951772117 0.1284199068 1.8331653575 [76] 1.0690987584 -0.4947246086 1.1750864383 -1.2671835248 1.4699203883 [81] 0.8259162783 0.9712007122 1.4296660090 0.5258449430 0.2753403165 [86] -0.4388660603 -0.5261799026 2.4544428350 -1.2148287261 -2.0361054258 [91] -0.2399285861 0.6389940453 -1.3966220096 0.5302581512 0.5082996118 [96] -0.1536872558 -0.7199670885 1.5323178758 0.9554150651 1.7153353663 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] 0.2712896 -0.9277453 0.4596122 1.237555 1.646654 1.035267 1.07234 [2,] 0.2712896 -0.9277453 0.4596122 1.237555 1.646654 1.035267 1.07234 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] -0.3486596 -1.998273 0.9465405 0.5312702 -0.951728 1.32143 0.5968085 [2,] -0.3486596 -1.998273 0.9465405 0.5312702 -0.951728 1.32143 0.5968085 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 0.6660487 0.8680301 -0.6353166 1.596018 0.3986035 0.6613751 -1.946384 [2,] 0.6660487 0.8680301 -0.6353166 1.596018 0.3986035 0.6613751 -1.946384 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.5900318 0.7079322 -1.380894 -0.171903 -0.2748003 0.1038973 -0.7016028 [2,] -0.5900318 0.7079322 -1.380894 -0.171903 -0.2748003 0.1038973 -0.7016028 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -1.600439 0.3471654 -0.04726663 0.4095279 0.01907596 0.06694556 -1.379537 [2,] -1.600439 0.3471654 -0.04726663 0.4095279 0.01907596 0.06694556 -1.379537 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 0.8908365 0.02919887 0.2845636 0.208865 -0.9592826 -0.4250608 -0.3747334 [2,] 0.8908365 0.02919887 0.2845636 0.208865 -0.9592826 -0.4250608 -0.3747334 [,43] [,44] [,45] [,46] [,47] [,48] [1,] -0.705462 -0.7370066 -0.0009426421 -0.7139734 0.2761348 -0.336892 [2,] -0.705462 -0.7370066 -0.0009426421 -0.7139734 0.2761348 -0.336892 [,49] [,50] [,51] [,52] [,53] [,54] [,55] [1,] -1.591811 0.5993106 -0.5865257 -3.547045 1.337621 -0.05495584 -0.7531938 [2,] -1.591811 0.5993106 -0.5865257 -3.547045 1.337621 -0.05495584 -0.7531938 [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] 0.450625 0.3814742 -0.7950022 -2.019104 0.01760708 -0.9604922 1.245747 [2,] 0.450625 0.3814742 -0.7950022 -2.019104 0.01760708 -0.9604922 1.245747 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [1,] -0.08936605 -1.40765 0.3223004 1.025929 -0.8644015 0.1035453 0.4733167 [2,] -0.08936605 -1.40765 0.3223004 1.025929 -0.8644015 0.1035453 0.4733167 [,70] [,71] [,72] [,73] [,74] [,75] [,76] [1,] 1.256861 -1.117205 0.9830327 1.895177 0.1284199 1.833165 1.069099 [2,] 1.256861 -1.117205 0.9830327 1.895177 0.1284199 1.833165 1.069099 [,77] [,78] [,79] [,80] [,81] [,82] [,83] [1,] -0.4947246 1.175086 -1.267184 1.46992 0.8259163 0.9712007 1.429666 [2,] -0.4947246 1.175086 -1.267184 1.46992 0.8259163 0.9712007 1.429666 [,84] [,85] [,86] [,87] [,88] [,89] [,90] [1,] 0.5258449 0.2753403 -0.4388661 -0.5261799 2.454443 -1.214829 -2.036105 [2,] 0.5258449 0.2753403 -0.4388661 -0.5261799 2.454443 -1.214829 -2.036105 [,91] [,92] [,93] [,94] [,95] [,96] [,97] [1,] -0.2399286 0.638994 -1.396622 0.5302582 0.5082996 -0.1536873 -0.7199671 [2,] -0.2399286 0.638994 -1.396622 0.5302582 0.5082996 -0.1536873 -0.7199671 [,98] [,99] [,100] [1,] 1.532318 0.9554151 1.715335 [2,] 1.532318 0.9554151 1.715335 > > > Max(tmp2) [1] 2.749819 > Min(tmp2) [1] -2.83076 > mean(tmp2) [1] -0.06630735 > Sum(tmp2) [1] -6.630735 > Var(tmp2) [1] 1.048835 > > rowMeans(tmp2) [1] 2.085057250 1.197719059 -0.969751423 -0.367098756 -0.519395645 [6] 0.751537523 0.487687105 -1.577976711 -0.486287265 -0.007767759 [11] 2.749819237 -0.212736692 0.893945092 -0.571960515 -0.282163876 [16] -1.232296747 0.371112018 -2.172879545 -1.879673094 0.434701515 [21] 0.571136127 -1.197813758 -0.855218943 -0.656548512 0.348920481 [26] 0.427832803 0.305850398 -0.481697267 -0.427124800 -2.149491818 [31] 2.542978748 -1.189286205 -0.798251254 -0.818040003 0.819451912 [36] -0.391764245 -0.448699109 0.473498057 0.458221317 0.149256709 [41] -0.788873835 -0.170441439 -0.262828665 -2.503965569 -0.108298813 [46] -0.203450957 -0.649663017 0.398026728 1.282716756 -0.427777277 [51] -0.134003578 -1.785019399 -0.904189151 1.544649896 -1.165104161 [56] 0.964395268 -0.559467697 1.197806762 1.994046153 0.190616123 [61] 0.008517828 -0.305891389 -0.734831245 0.462014026 0.272189357 [66] 0.255078333 -0.164791917 -0.241959909 -0.203229230 1.242889968 [71] -0.103933237 0.946738557 -0.064573393 -1.566436467 0.776681168 [76] 0.728012632 1.129545826 0.789508361 0.052328972 0.141668328 [81] 0.031569790 0.446270304 -1.094441094 -0.995891121 0.359478009 [86] -0.310726459 -1.222187501 -0.070860310 0.325729467 -0.327846314 [91] 0.317246364 0.880202026 1.921821306 -0.792549800 1.532449907 [96] -1.625821968 -2.830759628 -0.046878314 -0.186326319 0.355284065 > rowSums(tmp2) [1] 2.085057250 1.197719059 -0.969751423 -0.367098756 -0.519395645 [6] 0.751537523 0.487687105 -1.577976711 -0.486287265 -0.007767759 [11] 2.749819237 -0.212736692 0.893945092 -0.571960515 -0.282163876 [16] -1.232296747 0.371112018 -2.172879545 -1.879673094 0.434701515 [21] 0.571136127 -1.197813758 -0.855218943 -0.656548512 0.348920481 [26] 0.427832803 0.305850398 -0.481697267 -0.427124800 -2.149491818 [31] 2.542978748 -1.189286205 -0.798251254 -0.818040003 0.819451912 [36] -0.391764245 -0.448699109 0.473498057 0.458221317 0.149256709 [41] -0.788873835 -0.170441439 -0.262828665 -2.503965569 -0.108298813 [46] -0.203450957 -0.649663017 0.398026728 1.282716756 -0.427777277 [51] -0.134003578 -1.785019399 -0.904189151 1.544649896 -1.165104161 [56] 0.964395268 -0.559467697 1.197806762 1.994046153 0.190616123 [61] 0.008517828 -0.305891389 -0.734831245 0.462014026 0.272189357 [66] 0.255078333 -0.164791917 -0.241959909 -0.203229230 1.242889968 [71] -0.103933237 0.946738557 -0.064573393 -1.566436467 0.776681168 [76] 0.728012632 1.129545826 0.789508361 0.052328972 0.141668328 [81] 0.031569790 0.446270304 -1.094441094 -0.995891121 0.359478009 [86] -0.310726459 -1.222187501 -0.070860310 0.325729467 -0.327846314 [91] 0.317246364 0.880202026 1.921821306 -0.792549800 1.532449907 [96] -1.625821968 -2.830759628 -0.046878314 -0.186326319 0.355284065 > 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] 2.085057250 1.197719059 -0.969751423 -0.367098756 -0.519395645 [6] 0.751537523 0.487687105 -1.577976711 -0.486287265 -0.007767759 [11] 2.749819237 -0.212736692 0.893945092 -0.571960515 -0.282163876 [16] -1.232296747 0.371112018 -2.172879545 -1.879673094 0.434701515 [21] 0.571136127 -1.197813758 -0.855218943 -0.656548512 0.348920481 [26] 0.427832803 0.305850398 -0.481697267 -0.427124800 -2.149491818 [31] 2.542978748 -1.189286205 -0.798251254 -0.818040003 0.819451912 [36] -0.391764245 -0.448699109 0.473498057 0.458221317 0.149256709 [41] -0.788873835 -0.170441439 -0.262828665 -2.503965569 -0.108298813 [46] -0.203450957 -0.649663017 0.398026728 1.282716756 -0.427777277 [51] -0.134003578 -1.785019399 -0.904189151 1.544649896 -1.165104161 [56] 0.964395268 -0.559467697 1.197806762 1.994046153 0.190616123 [61] 0.008517828 -0.305891389 -0.734831245 0.462014026 0.272189357 [66] 0.255078333 -0.164791917 -0.241959909 -0.203229230 1.242889968 [71] -0.103933237 0.946738557 -0.064573393 -1.566436467 0.776681168 [76] 0.728012632 1.129545826 0.789508361 0.052328972 0.141668328 [81] 0.031569790 0.446270304 -1.094441094 -0.995891121 0.359478009 [86] -0.310726459 -1.222187501 -0.070860310 0.325729467 -0.327846314 [91] 0.317246364 0.880202026 1.921821306 -0.792549800 1.532449907 [96] -1.625821968 -2.830759628 -0.046878314 -0.186326319 0.355284065 > rowMin(tmp2) [1] 2.085057250 1.197719059 -0.969751423 -0.367098756 -0.519395645 [6] 0.751537523 0.487687105 -1.577976711 -0.486287265 -0.007767759 [11] 2.749819237 -0.212736692 0.893945092 -0.571960515 -0.282163876 [16] -1.232296747 0.371112018 -2.172879545 -1.879673094 0.434701515 [21] 0.571136127 -1.197813758 -0.855218943 -0.656548512 0.348920481 [26] 0.427832803 0.305850398 -0.481697267 -0.427124800 -2.149491818 [31] 2.542978748 -1.189286205 -0.798251254 -0.818040003 0.819451912 [36] -0.391764245 -0.448699109 0.473498057 0.458221317 0.149256709 [41] -0.788873835 -0.170441439 -0.262828665 -2.503965569 -0.108298813 [46] -0.203450957 -0.649663017 0.398026728 1.282716756 -0.427777277 [51] -0.134003578 -1.785019399 -0.904189151 1.544649896 -1.165104161 [56] 0.964395268 -0.559467697 1.197806762 1.994046153 0.190616123 [61] 0.008517828 -0.305891389 -0.734831245 0.462014026 0.272189357 [66] 0.255078333 -0.164791917 -0.241959909 -0.203229230 1.242889968 [71] -0.103933237 0.946738557 -0.064573393 -1.566436467 0.776681168 [76] 0.728012632 1.129545826 0.789508361 0.052328972 0.141668328 [81] 0.031569790 0.446270304 -1.094441094 -0.995891121 0.359478009 [86] -0.310726459 -1.222187501 -0.070860310 0.325729467 -0.327846314 [91] 0.317246364 0.880202026 1.921821306 -0.792549800 1.532449907 [96] -1.625821968 -2.830759628 -0.046878314 -0.186326319 0.355284065 > > colMeans(tmp2) [1] -0.06630735 > colSums(tmp2) [1] -6.630735 > colVars(tmp2) [1] 1.048835 > colSd(tmp2) [1] 1.024127 > colMax(tmp2) [1] 2.749819 > colMin(tmp2) [1] -2.83076 > colMedians(tmp2) [1] -0.106116 > colRanges(tmp2) [,1] [1,] -2.830760 [2,] 2.749819 > > 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] -4.8622061 0.2920802 -2.6481006 5.3020215 -1.0011859 -2.7087295 [7] -2.9761553 0.7965204 -4.3675562 -1.6055538 > colApply(tmp,quantile)[,1] [,1] [1,] -2.58424211 [2,] -1.07776488 [3,] -0.08519235 [4,] 0.19656227 [5,] 1.01273812 > > rowApply(tmp,sum) [1] 0.006966203 -1.845865433 -0.349635840 -6.132461023 -3.148882949 [6] -4.005296804 0.126295222 0.432027825 2.347478127 -1.209490534 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 4 5 5 1 2 10 10 5 1 1 [2,] 10 7 4 6 1 5 8 2 9 7 [3,] 5 8 10 2 10 9 1 3 3 4 [4,] 9 4 9 8 9 4 3 1 10 10 [5,] 1 6 6 9 3 3 7 8 8 5 [6,] 8 9 2 10 5 6 2 4 5 3 [7,] 6 2 3 5 6 2 9 9 7 6 [8,] 7 10 7 4 4 7 6 7 2 9 [9,] 2 3 1 3 7 1 5 6 6 8 [10,] 3 1 8 7 8 8 4 10 4 2 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] -3.38853644 -1.55828779 -3.26459219 -1.51758484 -1.53832210 1.32914167 [7] 2.13840367 -1.24429349 -0.69477026 1.43991903 -1.18727340 -1.60424276 [13] 0.40125165 0.19610907 0.04022741 1.35771430 -0.56409416 1.45686953 [19] -1.99697024 0.41680716 > colApply(tmp,quantile)[,1] [,1] [1,] -1.7974987 [2,] -1.4077011 [3,] -0.6145965 [4,] -0.3470454 [5,] 0.7783053 > > rowApply(tmp,sum) [1] -0.8956464 -5.8980547 -0.8179815 4.6042855 -6.7751271 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 3 17 8 3 2 [2,] 6 11 6 11 8 [3,] 2 13 14 1 16 [4,] 9 7 3 13 10 [5,] 4 3 17 15 12 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] -1.7974987 -0.3105415 -2.45928062 -0.04726802 -0.6782766 -0.3549882 [2,] 0.7783053 -0.1835306 0.12648264 -0.57942528 -1.9423803 -0.3900559 [3,] -0.3470454 -0.6242595 0.02313697 -0.87232114 0.6710494 -0.1590325 [4,] -0.6145965 0.3441571 -1.51530893 0.61653679 0.7851357 1.0761576 [5,] -1.4077011 -0.7841132 0.56037775 -0.63510719 -0.3738502 1.1570607 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 1.3619211 -0.1406055 0.7022405 1.26317323 0.04502446 1.1009592 [2,] 1.4068352 -1.2737629 0.4839923 1.10700368 -0.60014047 0.2421451 [3,] -1.1515064 -0.4096191 0.6534368 -0.33954646 0.65261244 -1.5039550 [4,] 1.1182539 -0.1757496 -1.1688871 0.07544854 -0.43838754 0.4072515 [5,] -0.5971002 0.7554436 -1.3655528 -0.66615995 -0.84638230 -1.8506434 [,13] [,14] [,15] [,16] [,17] [,18] [1,] 1.88407864 0.8545313 0.4235964 0.11163134 1.2538816 -0.01261505 [2,] -2.09628250 -0.3268909 -2.0105276 0.80097417 -0.3525549 0.06495953 [3,] -0.04300963 -0.6927972 1.7870026 -0.02011355 -0.0852364 1.09428975 [4,] 0.97731612 -0.2265919 0.6476638 0.03775979 -0.5524836 1.33400485 [5,] -0.32085099 0.5878577 -0.8075077 0.42746256 -0.8277008 -1.02376955 [,19] [,20] [1,] -4.0031981 -0.09241184 [2,] -1.7130867 0.55988556 [3,] 1.3314182 -0.78248540 [4,] 1.5333531 0.34325210 [5,] 0.8545434 0.38856674 > > > is.BufferedMatrix(tmp) [1] TRUE > > as.BufferedMatrix(as.matrix(tmp)) BufferedMatrix object Matrix size: 5 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 800 bytes. > > > > subBufferedMatrix(tmp,1:5,1:5) BufferedMatrix object Matrix size: 5 5 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 649 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-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.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -0.4676913 0.1214973 0.7595219 1.848867 0.5740679 0.7328576 -1.194279 col8 col9 col10 col11 col12 col13 col14 row1 1.642781 -0.2579133 -0.4873401 1.553949 -1.094306 0.6067459 -0.6008602 col15 col16 col17 col18 col19 col20 row1 -0.8380746 -0.8108711 -1.528754 0.6253833 -1.477367 -0.4033352 > tmp[,"col10"] col10 row1 -0.48734006 row2 0.60686722 row3 0.58417066 row4 0.02955144 row5 0.88708125 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 row1 -0.4676913 0.1214973 0.7595219 1.8488667 0.5740679 0.7328576 -1.194279 row5 1.1372203 0.2265720 -1.1275826 0.1037642 -0.3459809 2.2529489 -0.937862 col8 col9 col10 col11 col12 col13 row1 1.64278060 -0.2579133 -0.4873401 1.5539494 -1.0943058 0.6067459 row5 0.04608706 0.8681143 0.8870812 -0.2553661 -0.5536286 -1.1241096 col14 col15 col16 col17 col18 col19 row1 -0.6008602 -0.83807458 -0.8108711 -1.528754 0.6253833 -1.4773669 row5 -0.6286053 0.01440566 0.9246135 1.692842 -0.1590170 0.5951599 col20 row1 -0.4033352 row5 0.7795668 > tmp[,c("col6","col20")] col6 col20 row1 0.73285762 -0.4033352 row2 0.08262545 0.2462064 row3 0.28140355 1.1258363 row4 -0.98305835 -1.9508956 row5 2.25294885 0.7795668 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 0.7328576 -0.4033352 row5 2.2529489 0.7795668 > > > > > 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 49.35312 50.39535 49.31765 48.20362 50.31532 107.0214 48.75737 50.10378 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.38531 48.14267 50.22644 49.15653 51.18333 49.80473 49.18304 51.03846 col17 col18 col19 col20 row1 52.16675 49.89869 51.72178 105.1941 > tmp[,"col10"] col10 row1 48.14267 row2 31.42282 row3 30.75708 row4 30.63090 row5 50.97878 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 49.35312 50.39535 49.31765 48.20362 50.31532 107.0214 48.75737 50.10378 row5 49.61726 51.41048 50.01822 50.46375 51.08423 102.9255 49.53942 48.66020 col9 col10 col11 col12 col13 col14 col15 col16 row1 50.38531 48.14267 50.22644 49.15653 51.18333 49.80473 49.18304 51.03846 row5 50.13586 50.97878 50.26266 51.85338 50.65171 50.98350 51.58482 49.83976 col17 col18 col19 col20 row1 52.16675 49.89869 51.72178 105.1941 row5 50.45588 51.02795 49.48386 104.9176 > tmp[,c("col6","col20")] col6 col20 row1 107.02143 105.19407 row2 73.99196 76.65645 row3 73.64515 75.51514 row4 74.42941 74.23173 row5 102.92552 104.91764 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 107.0214 105.1941 row5 102.9255 104.9176 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 107.0214 105.1941 row5 102.9255 104.9176 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] -0.1568969 [2,] 0.3837254 [3,] -0.2786158 [4,] -0.5651491 [5,] -0.1390453 > tmp[,c("col17","col7")] col17 col7 [1,] -0.4697544 -0.07065441 [2,] 0.9303079 0.47561746 [3,] -0.1546459 -0.85953662 [4,] -0.7951389 -0.90651604 [5,] 0.7080696 0.07474303 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -0.9333531 1.4562584 [2,] 1.3560520 1.4807660 [3,] -0.3829015 1.9329652 [4,] -1.6515867 -0.5649397 [5,] 0.1349453 -0.5289982 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -0.9333531 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -0.9333531 [2,] 1.3560520 > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > > > > subBufferedMatrix(tmp,c("row3","row1"),)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row3 -0.2778112 -0.1443687 0.9619978 1.7026355 -1.6792368 -1.2589115 1.1705576 row1 -0.2453317 -0.5230590 0.2735140 0.6291693 -0.9678835 0.9733492 -0.6700751 [,8] [,9] [,10] [,11] [,12] [,13] row3 -1.884311 2.2582333 -2.3148852 -0.08387351 1.4338492 0.3490699 row1 -2.607271 -0.5937881 -0.8365454 -0.80843764 0.3610979 -0.8989343 [,14] [,15] [,16] [,17] [,18] [,19] [,20] row3 -1.6216468 1.324229 1.21946986 -2.5411963 0.5860927 -2.054266 0.2749827 row1 0.0499442 -2.316057 0.08222448 0.2419911 -0.6112218 1.390218 0.5319826 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 -0.9669503 -0.1944118 0.6782175 2.600735 -0.5649687 -0.1678141 -0.4652953 [,8] [,9] [,10] row2 -0.1669071 1.750745 0.1439255 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 0.463441 -0.3224871 -1.324949 -0.7841581 1.215133 -2.171643 1.217153 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 0.439758 0.04945548 -1.817245 1.131693 0.2017034 -1.192982 -1.163325 [,15] [,16] [,17] [,18] [,19] [,20] row5 0.989501 -0.7404336 1.838951 -1.138749 -0.1384827 -1.31899 > > > 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: 0x600001494f60> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87377bcce396" [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87374871cc59" [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM8737271f0c37" [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM8737675b02f1" [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM873781e513a" [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87377e66baff" [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM8737a7efc2e" [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM873716de3564" [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM8737568343f6" [10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM873743e2f7d9" [11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM873769fdea60" [12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87371d267afd" [13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM8737495486fe" [14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87374c6ab34e" [15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM87377121ed13" > > > ### 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: 0x600001480420> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x600001480420> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x600001480420> > rowMedians(tmp) [1] -0.263567457 0.459578198 -0.577847115 -0.142392777 0.250436838 [6] 0.361944629 0.369012156 -0.062552545 -0.410295002 0.694856140 [11] -0.500701799 -0.177961657 0.214242176 -0.209720023 -0.117756625 [16] 0.363571224 0.158553215 0.334587341 -0.364101593 0.650855030 [21] 0.019788212 -0.082338431 0.158754395 -0.627197080 -0.416026913 [26] -0.322200822 0.189774083 0.009507688 -0.087815804 0.640219720 [31] 0.030145635 0.059058990 0.212028856 0.063991464 -0.352894859 [36] 0.171334090 -0.202355968 0.199522029 0.396493791 0.021971191 [41] -0.318328657 0.102498032 -0.096454065 -0.091492330 -0.421027477 [46] -0.431141545 -0.318314535 0.401197402 0.123075649 0.595789820 [51] 0.200512188 0.038644702 -0.126410470 0.550820625 -0.069180220 [56] -0.222788955 -0.227681672 0.223677441 0.483214708 0.485005805 [61] -0.220153807 0.797447199 0.460541103 0.196656600 0.305124187 [66] 0.328753033 0.014524308 -0.159029730 0.328314633 0.231333793 [71] 0.310219045 -0.104494604 -0.341643227 0.263756072 0.299974297 [76] 0.311952205 0.081984822 0.288087365 0.448350328 0.711405242 [81] -0.630224519 0.225003304 -0.136837989 0.019417128 -0.679340317 [86] 0.164988111 -0.891306709 -0.143876826 -0.174557787 0.257493959 [91] -0.290062300 -0.008786480 -0.335194236 0.770645032 0.658144650 [96] 0.390160349 0.097375323 -0.027612598 -0.093564477 -0.438922518 [101] -0.088629652 0.020323211 0.327826494 0.137292675 -0.077303818 [106] 0.205599957 -0.143176845 -0.019513235 -0.487530794 0.421041332 [111] 0.465951938 -0.119097356 0.567217885 -0.317959583 -0.015303230 [116] -0.313417740 0.527884471 0.001526298 -0.184567369 0.497539426 [121] -0.036238841 -0.374741268 -0.058663390 0.379543913 -0.185785859 [126] -0.328824386 0.068994955 -0.505343451 0.322829958 0.223612188 [131] -0.614494233 0.299575088 -0.171700428 -0.251377527 0.469236907 [136] -0.386894083 -0.103302478 -0.211185546 -0.006457308 -0.183086327 [141] 0.606600909 -0.032959643 -0.212656263 0.306343904 -0.643191057 [146] -0.361806002 -0.589273997 0.434034950 -0.121874251 -0.064449028 [151] 0.277794199 0.361352169 -0.177822603 -0.170507057 0.149024177 [156] -1.266388258 0.059203970 0.020539805 -0.293789130 0.470450504 [161] -0.327719994 0.326184272 0.390798144 0.020329820 0.885680551 [166] 0.045073016 -0.551632299 0.056757668 -0.630923182 0.090891002 [171] -0.194837583 -0.322686697 0.017321213 0.405194105 -0.436686078 [176] 0.272683344 -0.054006923 -0.113832901 0.130050525 -0.127754587 [181] 0.096673561 -0.470368604 -0.126477368 0.130707875 0.003039417 [186] -0.353796100 0.130023223 -0.516849134 0.123668962 0.480432855 [191] 0.234159661 0.649737750 -0.365576577 -0.095506953 0.261026182 [196] -0.022249517 -0.353330204 0.277088711 -0.276147226 -0.367915025 [201] 0.091185595 -0.311719547 -0.251200842 -0.004606000 -0.578146131 [206] 0.253855168 -0.320569899 0.509719343 -0.182545111 0.457224316 [211] 0.251618140 0.100860081 0.080603807 0.082365278 0.115066549 [216] 0.470861687 0.285185515 -0.278203412 -0.345267101 0.187486718 [221] 0.151333950 0.679050269 0.419979184 -0.147998910 0.310122781 [226] 0.333860132 0.034815398 -0.395222707 0.547513360 0.414755097 > > proc.time() user system elapsed 0.611 2.526 3.173
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-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: 0x60000032cde0> > .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: 0x60000032cde0> > .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: 0x60000032cde0> > .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: 0x60000032cde0> > 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: 0x60000032d3e0> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032d3e0> > .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: 0x60000032d3e0> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032d3e0> > .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: 0x60000032d3e0> > 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: 0x60000032d5c0> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032d5c0> > .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: 0x60000032d5c0> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x60000032d5c0> > .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: 0x60000032d5c0> > > .Call("R_bm_RowMode",P) <pointer: 0x60000032d5c0> > .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: 0x60000032d5c0> > > .Call("R_bm_ColMode",P) <pointer: 0x60000032d5c0> > .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: 0x60000032d5c0> > 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: 0x60000032d7a0> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x60000032d7a0> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032d7a0> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032d7a0> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile87515a40eb13" "BufferedMatrixFile87515c095aaf" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile87515a40eb13" "BufferedMatrixFile87515c095aaf" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x60000032da40> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032da40> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x60000032da40> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x60000032da40> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x60000032da40> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x60000032da40> > .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: 0x60000032dc20> > .Call("R_bm_AddColumn",P) <pointer: 0x60000032dc20> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x60000032dc20> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x60000032dc20> > 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: 0x60000032de00> > .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: 0x60000032de00> > rm(P) > > proc.time() user system elapsed 0.110 0.035 0.142
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.4.1 (2024-06-14) -- "Race for Your Life" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-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.108 0.021 0.126