Back to Multiple platform build/check report for BioC 3.20: simplified long |
|
This page was generated on 2024-11-09 21:30 -0500 (Sat, 09 Nov 2024).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
teran2 | Linux (Ubuntu 24.04.1 LTS) | x86_64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4505 |
palomino8 | Windows Server 2022 Datacenter | x64 | 4.4.1 (2024-06-14 ucrt) -- "Race for Your Life" | 4506 |
lconway | macOS 12.7.1 Monterey | x86_64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4538 |
kjohnson3 | macOS 13.6.5 Ventura | arm64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4486 |
kunpeng2 | Linux (openEuler 22.03 LTS-SP1) | aarch64 | 4.4.1 (2024-06-14) -- "Race for Your Life" | 4493 |
Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X |
Package 251/2289 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.70.0 (landing page) Ben Bolstad
| teran2 | Linux (Ubuntu 24.04.1 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 | |||||||||
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.70.0 |
Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz |
StartedAt: 2024-11-08 21:53:21 -0500 (Fri, 08 Nov 2024) |
EndedAt: 2024-11-08 21:57:19 -0500 (Fri, 08 Nov 2024) |
EllapsedTime: 237.3 seconds |
RetCode: 0 |
Status: WARNINGS |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 1 |
############################################################################## ############################################################################## ### ### Running command: ### ### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.70.0.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck’ * using R version 4.4.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.70.0’ * checking package namespace information ... OK * checking package dependencies ...Warning: unable to access index for repository https://CRAN.R-project.org/src/contrib: cannot open URL 'https://CRAN.R-project.org/src/contrib/PACKAGES' 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.104 0.031 0.131
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 1035434 55.3 NA 638577 34.2 Vcells 877599 6.7 8388608 64.0 196608 2072868 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] "Fri Nov 8 21:57:12 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] "Fri Nov 8 21:57:12 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: 0x6000007dc060> > > > > 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] "Fri Nov 8 21:57:13 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] "Fri Nov 8 21:57:13 2024" > > ColMode(tmp2) <pointer: 0x6000007dc060> > > > > ### 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.5607052 -1.81843843 0.4274427 -1.7795664 [2,] 0.1905437 -0.13046696 0.2964315 -0.7246343 [3,] 1.7442880 0.08410885 -1.5533583 0.2251481 [4,] -0.1124249 -0.13988810 -1.6249535 0.6318479 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 100.5607052 1.81843843 0.4274427 1.7795664 [2,] 0.1905437 0.13046696 0.2964315 0.7246343 [3,] 1.7442880 0.08410885 1.5533583 0.2251481 [4,] 0.1124249 0.13988810 1.6249535 0.6318479 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 10.0279961 1.3484949 0.6537910 1.3340039 [2,] 0.4365131 0.3612021 0.5444552 0.8512545 [3,] 1.3207149 0.2900153 1.2463380 0.4744977 [4,] 0.3352982 0.3740162 1.2747366 0.7948886 > > my.function <- function(x,power){ + (x+5)^power + } > > ewApply(tmp5,my.function,power=2) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 225.84067 40.30339 31.96535 40.11961 [2,] 29.55567 28.74249 30.74098 34.23718 [3,] 39.95144 27.98426 39.01674 29.97013 [4,] 28.46541 28.88005 39.37232 33.58073 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x6000007d0780> > exp(tmp5) <pointer: 0x6000007d0780> > log(tmp5,2) <pointer: 0x6000007d0780> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 470.0578 > Min(tmp5) [1] 53.73417 > mean(tmp5) [1] 73.22313 > Sum(tmp5) [1] 14644.63 > Var(tmp5) [1] 861.1738 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 93.39071 67.75412 71.15655 68.70234 68.93562 74.25391 72.57833 73.94990 [9] 70.89443 70.61539 > rowSums(tmp5) [1] 1867.814 1355.082 1423.131 1374.047 1378.712 1485.078 1451.567 1478.998 [9] 1417.889 1412.308 > rowVars(tmp5) [1] 7917.67617 44.53277 59.60307 66.33252 54.01961 66.97439 [7] 71.95198 95.17289 65.48422 57.95432 > rowSd(tmp5) [1] 88.981325 6.673288 7.720302 8.144478 7.349804 8.183788 8.482451 [8] 9.755659 8.092232 7.612774 > rowMax(tmp5) [1] 470.05776 79.62594 84.06036 89.54514 81.12803 90.33149 86.86145 [8] 89.56807 88.53425 87.50035 > rowMin(tmp5) [1] 62.05452 58.45295 58.24557 57.03855 59.30101 60.53805 56.32072 53.73417 [9] 59.07959 58.98354 > > colMeans(tmp5) [1] 110.52431 70.56988 73.76001 70.04242 70.04989 68.94778 69.58152 [8] 72.74213 73.37828 76.56307 71.75222 70.03670 74.84813 73.07191 [15] 70.06956 69.07260 67.17727 71.69346 72.21299 68.36845 > colSums(tmp5) [1] 1105.2431 705.6988 737.6001 700.4242 700.4989 689.4778 695.8152 [8] 727.4213 733.7828 765.6307 717.5222 700.3670 748.4813 730.7191 [15] 700.6956 690.7260 671.7727 716.9346 722.1299 683.6845 > colVars(tmp5) [1] 16022.00735 91.14378 77.00323 62.79627 63.92292 48.36870 [7] 70.34812 85.66072 36.54823 95.04769 108.53083 57.69179 [13] 94.50443 104.72357 41.09772 50.08365 26.17775 93.01876 [19] 44.41176 26.78177 > colSd(tmp5) [1] 126.578068 9.546925 8.775149 7.924410 7.995181 6.954761 [7] 8.387379 9.255308 6.045513 9.749240 10.417813 7.595511 [13] 9.721339 10.233454 6.410750 7.076980 5.116420 9.644623 [19] 6.664215 5.175111 > colMax(tmp5) [1] 470.05776 83.88622 81.94833 83.50370 84.41895 80.31394 81.49762 [8] 90.33149 85.81863 91.05331 89.54514 82.08957 87.68002 87.50035 [15] 79.35600 78.46380 76.48470 89.56807 84.06036 76.91744 > colMin(tmp5) [1] 59.24702 58.24557 60.51790 53.73417 60.53805 59.59469 59.30101 60.87171 [9] 63.51009 61.27863 58.98354 61.03007 59.21027 57.03855 60.25550 59.13419 [17] 59.47537 56.32072 64.63671 58.45295 > > > ### 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] 93.39071 NA 71.15655 68.70234 68.93562 74.25391 72.57833 73.94990 [9] 70.89443 70.61539 > rowSums(tmp5) [1] 1867.814 NA 1423.131 1374.047 1378.712 1485.078 1451.567 1478.998 [9] 1417.889 1412.308 > rowVars(tmp5) [1] 7917.67617 38.76469 59.60307 66.33252 54.01961 66.97439 [7] 71.95198 95.17289 65.48422 57.95432 > rowSd(tmp5) [1] 88.981325 6.226130 7.720302 8.144478 7.349804 8.183788 8.482451 [8] 9.755659 8.092232 7.612774 > rowMax(tmp5) [1] 470.05776 NA 84.06036 89.54514 81.12803 90.33149 86.86145 [8] 89.56807 88.53425 87.50035 > rowMin(tmp5) [1] 62.05452 NA 58.24557 57.03855 59.30101 60.53805 56.32072 53.73417 [9] 59.07959 58.98354 > > colMeans(tmp5) [1] 110.52431 70.56988 73.76001 70.04242 70.04989 68.94778 69.58152 [8] 72.74213 73.37828 76.56307 71.75222 70.03670 NA 73.07191 [15] 70.06956 69.07260 67.17727 71.69346 72.21299 68.36845 > colSums(tmp5) [1] 1105.2431 705.6988 737.6001 700.4242 700.4989 689.4778 695.8152 [8] 727.4213 733.7828 765.6307 717.5222 700.3670 NA 730.7191 [15] 700.6956 690.7260 671.7727 716.9346 722.1299 683.6845 > colVars(tmp5) [1] 16022.00735 91.14378 77.00323 62.79627 63.92292 48.36870 [7] 70.34812 85.66072 36.54823 95.04769 108.53083 57.69179 [13] NA 104.72357 41.09772 50.08365 26.17775 93.01876 [19] 44.41176 26.78177 > colSd(tmp5) [1] 126.578068 9.546925 8.775149 7.924410 7.995181 6.954761 [7] 8.387379 9.255308 6.045513 9.749240 10.417813 7.595511 [13] NA 10.233454 6.410750 7.076980 5.116420 9.644623 [19] 6.664215 5.175111 > colMax(tmp5) [1] 470.05776 83.88622 81.94833 83.50370 84.41895 80.31394 81.49762 [8] 90.33149 85.81863 91.05331 89.54514 82.08957 NA 87.50035 [15] 79.35600 78.46380 76.48470 89.56807 84.06036 76.91744 > colMin(tmp5) [1] 59.24702 58.24557 60.51790 53.73417 60.53805 59.59469 59.30101 60.87171 [9] 63.51009 61.27863 58.98354 61.03007 NA 57.03855 60.25550 59.13419 [17] 59.47537 56.32072 64.63671 58.45295 > > Max(tmp5,na.rm=TRUE) [1] 470.0578 > Min(tmp5,na.rm=TRUE) [1] 53.73417 > mean(tmp5,na.rm=TRUE) [1] 73.19095 > Sum(tmp5,na.rm=TRUE) [1] 14565 > Var(tmp5,na.rm=TRUE) [1] 865.315 > > rowMeans(tmp5,na.rm=TRUE) [1] 93.39071 67.12928 71.15655 68.70234 68.93562 74.25391 72.57833 73.94990 [9] 70.89443 70.61539 > rowSums(tmp5,na.rm=TRUE) [1] 1867.814 1275.456 1423.131 1374.047 1378.712 1485.078 1451.567 1478.998 [9] 1417.889 1412.308 > rowVars(tmp5,na.rm=TRUE) [1] 7917.67617 38.76469 59.60307 66.33252 54.01961 66.97439 [7] 71.95198 95.17289 65.48422 57.95432 > rowSd(tmp5,na.rm=TRUE) [1] 88.981325 6.226130 7.720302 8.144478 7.349804 8.183788 8.482451 [8] 9.755659 8.092232 7.612774 > rowMax(tmp5,na.rm=TRUE) [1] 470.05776 79.37683 84.06036 89.54514 81.12803 90.33149 86.86145 [8] 89.56807 88.53425 87.50035 > rowMin(tmp5,na.rm=TRUE) [1] 62.05452 58.45295 58.24557 57.03855 59.30101 60.53805 56.32072 53.73417 [9] 59.07959 58.98354 > > colMeans(tmp5,na.rm=TRUE) [1] 110.52431 70.56988 73.76001 70.04242 70.04989 68.94778 69.58152 [8] 72.74213 73.37828 76.56307 71.75222 70.03670 74.31726 73.07191 [15] 70.06956 69.07260 67.17727 71.69346 72.21299 68.36845 > colSums(tmp5,na.rm=TRUE) [1] 1105.2431 705.6988 737.6001 700.4242 700.4989 689.4778 695.8152 [8] 727.4213 733.7828 765.6307 717.5222 700.3670 668.8553 730.7191 [15] 700.6956 690.7260 671.7727 716.9346 722.1299 683.6845 > colVars(tmp5,na.rm=TRUE) [1] 16022.00735 91.14378 77.00323 62.79627 63.92292 48.36870 [7] 70.34812 85.66072 36.54823 95.04769 108.53083 57.69179 [13] 103.14699 104.72357 41.09772 50.08365 26.17775 93.01876 [19] 44.41176 26.78177 > colSd(tmp5,na.rm=TRUE) [1] 126.578068 9.546925 8.775149 7.924410 7.995181 6.954761 [7] 8.387379 9.255308 6.045513 9.749240 10.417813 7.595511 [13] 10.156131 10.233454 6.410750 7.076980 5.116420 9.644623 [19] 6.664215 5.175111 > colMax(tmp5,na.rm=TRUE) [1] 470.05776 83.88622 81.94833 83.50370 84.41895 80.31394 81.49762 [8] 90.33149 85.81863 91.05331 89.54514 82.08957 87.68002 87.50035 [15] 79.35600 78.46380 76.48470 89.56807 84.06036 76.91744 > colMin(tmp5,na.rm=TRUE) [1] 59.24702 58.24557 60.51790 53.73417 60.53805 59.59469 59.30101 60.87171 [9] 63.51009 61.27863 58.98354 61.03007 59.21027 57.03855 60.25550 59.13419 [17] 59.47537 56.32072 64.63671 58.45295 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 93.39071 NaN 71.15655 68.70234 68.93562 74.25391 72.57833 73.94990 [9] 70.89443 70.61539 > rowSums(tmp5,na.rm=TRUE) [1] 1867.814 0.000 1423.131 1374.047 1378.712 1485.078 1451.567 1478.998 [9] 1417.889 1412.308 > rowVars(tmp5,na.rm=TRUE) [1] 7917.67617 NA 59.60307 66.33252 54.01961 66.97439 [7] 71.95198 95.17289 65.48422 57.95432 > rowSd(tmp5,na.rm=TRUE) [1] 88.981325 NA 7.720302 8.144478 7.349804 8.183788 8.482451 [8] 9.755659 8.092232 7.612774 > rowMax(tmp5,na.rm=TRUE) [1] 470.05776 NA 84.06036 89.54514 81.12803 90.33149 86.86145 [8] 89.56807 88.53425 87.50035 > rowMin(tmp5,na.rm=TRUE) [1] 62.05452 NA 58.24557 57.03855 59.30101 60.53805 56.32072 53.73417 [9] 59.07959 58.98354 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 115.96965 71.76390 74.84631 69.90711 70.64011 69.21630 69.72426 [8] 72.00494 74.47475 76.29063 71.59303 70.83799 NaN 72.80391 [15] 70.46617 69.93991 67.68184 71.74120 72.92652 69.47017 > colSums(tmp5,na.rm=TRUE) [1] 1043.7269 645.8751 673.6168 629.1640 635.7610 622.9467 627.5184 [8] 648.0445 670.2727 686.6156 644.3373 637.5419 0.0000 655.2352 [15] 634.1955 629.4592 609.1366 645.6708 656.3387 625.2315 > colVars(tmp5,na.rm=TRUE) [1] 17691.17649 86.49787 73.35316 70.43983 67.99428 53.60363 [7] 78.91242 90.25452 27.59158 106.09360 121.81210 57.68012 [13] NA 117.00598 44.46531 47.88154 26.58583 104.62047 [19] 44.23551 16.47433 > colSd(tmp5,na.rm=TRUE) [1] 133.008182 9.300423 8.564646 8.392844 8.245864 7.321450 [7] 8.883266 9.500238 5.252769 10.300175 11.036852 7.594743 [13] NA 10.816930 6.668232 6.919649 5.156145 10.228415 [19] 6.650978 4.058859 > colMax(tmp5,na.rm=TRUE) [1] 470.05776 83.88622 81.94833 83.50370 84.41895 80.31394 81.49762 [8] 90.33149 85.81863 91.05331 89.54514 82.08957 -Inf 87.50035 [15] 79.35600 78.46380 76.48470 89.56807 84.06036 76.91744 > colMin(tmp5,na.rm=TRUE) [1] 59.24702 58.24557 60.51790 53.73417 60.53805 59.59469 59.30101 60.87171 [9] 68.49943 61.27863 58.98354 61.03007 Inf 57.03855 60.25550 59.13419 [17] 59.47537 56.32072 64.63671 64.78478 > > > > > 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] 154.3619 226.9090 262.6235 171.3333 326.1019 127.8258 175.4944 205.4320 [9] 218.9421 134.0547 > apply(copymatrix,1,var,na.rm=TRUE) [1] 154.3619 226.9090 262.6235 171.3333 326.1019 127.8258 175.4944 205.4320 [9] 218.9421 134.0547 > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 1 > which.col <- 3 > cat(which.row," ",which.col,"\n") 1 3 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE) [1] -1.705303e-13 3.126388e-13 0.000000e+00 2.273737e-13 -5.684342e-14 [6] 2.842171e-14 -5.684342e-14 1.136868e-13 -8.526513e-14 -1.136868e-13 [11] 5.684342e-14 1.136868e-13 0.000000e+00 -5.684342e-14 -2.557954e-13 [16] -1.421085e-14 8.526513e-14 5.684342e-14 5.684342e-14 2.842171e-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) + } 3 12 8 5 6 4 6 13 6 19 1 11 9 17 10 15 6 8 2 10 7 9 8 15 1 10 10 6 3 4 4 6 10 1 2 9 9 20 9 2 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.997553 > Min(tmp) [1] -2.33136 > mean(tmp) [1] 0.06883962 > Sum(tmp) [1] 6.883962 > Var(tmp) [1] 1.243532 > > rowMeans(tmp) [1] 0.06883962 > rowSums(tmp) [1] 6.883962 > rowVars(tmp) [1] 1.243532 > rowSd(tmp) [1] 1.115138 > rowMax(tmp) [1] 2.997553 > rowMin(tmp) [1] -2.33136 > > colMeans(tmp) [1] -0.522394330 -0.195116272 -0.389022629 -0.769224850 -1.467869311 [6] -1.508727374 0.187934709 1.929056932 -2.163708452 0.572463070 [11] -0.003636571 -0.040614006 1.884596751 0.818454582 -0.099285997 [16] 0.542223661 0.746036400 -0.265439885 0.387069556 -0.424612241 [21] 0.005999456 -0.912169134 -0.888755090 -0.175490434 -0.115023055 [26] 0.320825105 0.958353711 2.315253235 -0.232398432 1.219550084 [31] 0.212024232 -0.506382907 0.236738925 -0.217105312 2.035841534 [36] 0.272950316 0.538969313 -1.324024780 1.328386755 -0.376496694 [41] -1.123859801 -1.244997009 0.683310074 1.036919293 0.448232074 [46] -0.356906987 -0.725137024 -0.526155010 -0.714595641 0.659004510 [51] 0.035736100 1.385850680 -1.274742903 1.047600126 0.577791514 [56] -2.327155148 0.766313049 -1.218671415 -0.208173076 -2.331360154 [61] 1.074698917 0.405828135 0.585722360 -0.556744503 1.033512851 [66] 2.122400991 -1.436290401 0.762329603 -2.309294733 -0.377328245 [71] -1.948626783 0.731619935 1.181079929 0.886578202 1.214769624 [76] -0.001105591 -1.107645154 0.298001694 2.997553475 -1.795363334 [81] 2.114483232 -1.905342644 -0.961366380 1.288087845 1.126282757 [86] 1.620296386 1.191742279 -0.534803365 0.687066372 -0.294664239 [91] 0.277392747 0.816344237 -1.916077736 -0.008852292 -0.183380686 [96] -0.410888981 -0.747484812 1.026953894 0.842182117 0.590060961 > colSums(tmp) [1] -0.522394330 -0.195116272 -0.389022629 -0.769224850 -1.467869311 [6] -1.508727374 0.187934709 1.929056932 -2.163708452 0.572463070 [11] -0.003636571 -0.040614006 1.884596751 0.818454582 -0.099285997 [16] 0.542223661 0.746036400 -0.265439885 0.387069556 -0.424612241 [21] 0.005999456 -0.912169134 -0.888755090 -0.175490434 -0.115023055 [26] 0.320825105 0.958353711 2.315253235 -0.232398432 1.219550084 [31] 0.212024232 -0.506382907 0.236738925 -0.217105312 2.035841534 [36] 0.272950316 0.538969313 -1.324024780 1.328386755 -0.376496694 [41] -1.123859801 -1.244997009 0.683310074 1.036919293 0.448232074 [46] -0.356906987 -0.725137024 -0.526155010 -0.714595641 0.659004510 [51] 0.035736100 1.385850680 -1.274742903 1.047600126 0.577791514 [56] -2.327155148 0.766313049 -1.218671415 -0.208173076 -2.331360154 [61] 1.074698917 0.405828135 0.585722360 -0.556744503 1.033512851 [66] 2.122400991 -1.436290401 0.762329603 -2.309294733 -0.377328245 [71] -1.948626783 0.731619935 1.181079929 0.886578202 1.214769624 [76] -0.001105591 -1.107645154 0.298001694 2.997553475 -1.795363334 [81] 2.114483232 -1.905342644 -0.961366380 1.288087845 1.126282757 [86] 1.620296386 1.191742279 -0.534803365 0.687066372 -0.294664239 [91] 0.277392747 0.816344237 -1.916077736 -0.008852292 -0.183380686 [96] -0.410888981 -0.747484812 1.026953894 0.842182117 0.590060961 > 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.522394330 -0.195116272 -0.389022629 -0.769224850 -1.467869311 [6] -1.508727374 0.187934709 1.929056932 -2.163708452 0.572463070 [11] -0.003636571 -0.040614006 1.884596751 0.818454582 -0.099285997 [16] 0.542223661 0.746036400 -0.265439885 0.387069556 -0.424612241 [21] 0.005999456 -0.912169134 -0.888755090 -0.175490434 -0.115023055 [26] 0.320825105 0.958353711 2.315253235 -0.232398432 1.219550084 [31] 0.212024232 -0.506382907 0.236738925 -0.217105312 2.035841534 [36] 0.272950316 0.538969313 -1.324024780 1.328386755 -0.376496694 [41] -1.123859801 -1.244997009 0.683310074 1.036919293 0.448232074 [46] -0.356906987 -0.725137024 -0.526155010 -0.714595641 0.659004510 [51] 0.035736100 1.385850680 -1.274742903 1.047600126 0.577791514 [56] -2.327155148 0.766313049 -1.218671415 -0.208173076 -2.331360154 [61] 1.074698917 0.405828135 0.585722360 -0.556744503 1.033512851 [66] 2.122400991 -1.436290401 0.762329603 -2.309294733 -0.377328245 [71] -1.948626783 0.731619935 1.181079929 0.886578202 1.214769624 [76] -0.001105591 -1.107645154 0.298001694 2.997553475 -1.795363334 [81] 2.114483232 -1.905342644 -0.961366380 1.288087845 1.126282757 [86] 1.620296386 1.191742279 -0.534803365 0.687066372 -0.294664239 [91] 0.277392747 0.816344237 -1.916077736 -0.008852292 -0.183380686 [96] -0.410888981 -0.747484812 1.026953894 0.842182117 0.590060961 > colMin(tmp) [1] -0.522394330 -0.195116272 -0.389022629 -0.769224850 -1.467869311 [6] -1.508727374 0.187934709 1.929056932 -2.163708452 0.572463070 [11] -0.003636571 -0.040614006 1.884596751 0.818454582 -0.099285997 [16] 0.542223661 0.746036400 -0.265439885 0.387069556 -0.424612241 [21] 0.005999456 -0.912169134 -0.888755090 -0.175490434 -0.115023055 [26] 0.320825105 0.958353711 2.315253235 -0.232398432 1.219550084 [31] 0.212024232 -0.506382907 0.236738925 -0.217105312 2.035841534 [36] 0.272950316 0.538969313 -1.324024780 1.328386755 -0.376496694 [41] -1.123859801 -1.244997009 0.683310074 1.036919293 0.448232074 [46] -0.356906987 -0.725137024 -0.526155010 -0.714595641 0.659004510 [51] 0.035736100 1.385850680 -1.274742903 1.047600126 0.577791514 [56] -2.327155148 0.766313049 -1.218671415 -0.208173076 -2.331360154 [61] 1.074698917 0.405828135 0.585722360 -0.556744503 1.033512851 [66] 2.122400991 -1.436290401 0.762329603 -2.309294733 -0.377328245 [71] -1.948626783 0.731619935 1.181079929 0.886578202 1.214769624 [76] -0.001105591 -1.107645154 0.298001694 2.997553475 -1.795363334 [81] 2.114483232 -1.905342644 -0.961366380 1.288087845 1.126282757 [86] 1.620296386 1.191742279 -0.534803365 0.687066372 -0.294664239 [91] 0.277392747 0.816344237 -1.916077736 -0.008852292 -0.183380686 [96] -0.410888981 -0.747484812 1.026953894 0.842182117 0.590060961 > colMedians(tmp) [1] -0.522394330 -0.195116272 -0.389022629 -0.769224850 -1.467869311 [6] -1.508727374 0.187934709 1.929056932 -2.163708452 0.572463070 [11] -0.003636571 -0.040614006 1.884596751 0.818454582 -0.099285997 [16] 0.542223661 0.746036400 -0.265439885 0.387069556 -0.424612241 [21] 0.005999456 -0.912169134 -0.888755090 -0.175490434 -0.115023055 [26] 0.320825105 0.958353711 2.315253235 -0.232398432 1.219550084 [31] 0.212024232 -0.506382907 0.236738925 -0.217105312 2.035841534 [36] 0.272950316 0.538969313 -1.324024780 1.328386755 -0.376496694 [41] -1.123859801 -1.244997009 0.683310074 1.036919293 0.448232074 [46] -0.356906987 -0.725137024 -0.526155010 -0.714595641 0.659004510 [51] 0.035736100 1.385850680 -1.274742903 1.047600126 0.577791514 [56] -2.327155148 0.766313049 -1.218671415 -0.208173076 -2.331360154 [61] 1.074698917 0.405828135 0.585722360 -0.556744503 1.033512851 [66] 2.122400991 -1.436290401 0.762329603 -2.309294733 -0.377328245 [71] -1.948626783 0.731619935 1.181079929 0.886578202 1.214769624 [76] -0.001105591 -1.107645154 0.298001694 2.997553475 -1.795363334 [81] 2.114483232 -1.905342644 -0.961366380 1.288087845 1.126282757 [86] 1.620296386 1.191742279 -0.534803365 0.687066372 -0.294664239 [91] 0.277392747 0.816344237 -1.916077736 -0.008852292 -0.183380686 [96] -0.410888981 -0.747484812 1.026953894 0.842182117 0.590060961 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.5223943 -0.1951163 -0.3890226 -0.7692249 -1.467869 -1.508727 0.1879347 [2,] -0.5223943 -0.1951163 -0.3890226 -0.7692249 -1.467869 -1.508727 0.1879347 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 1.929057 -2.163708 0.5724631 -0.003636571 -0.04061401 1.884597 0.8184546 [2,] 1.929057 -2.163708 0.5724631 -0.003636571 -0.04061401 1.884597 0.8184546 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] -0.099286 0.5422237 0.7460364 -0.2654399 0.3870696 -0.4246122 0.005999456 [2,] -0.099286 0.5422237 0.7460364 -0.2654399 0.3870696 -0.4246122 0.005999456 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] -0.9121691 -0.8887551 -0.1754904 -0.1150231 0.3208251 0.9583537 2.315253 [2,] -0.9121691 -0.8887551 -0.1754904 -0.1150231 0.3208251 0.9583537 2.315253 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.2323984 1.21955 0.2120242 -0.5063829 0.2367389 -0.2171053 2.035842 [2,] -0.2323984 1.21955 0.2120242 -0.5063829 0.2367389 -0.2171053 2.035842 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] 0.2729503 0.5389693 -1.324025 1.328387 -0.3764967 -1.12386 -1.244997 [2,] 0.2729503 0.5389693 -1.324025 1.328387 -0.3764967 -1.12386 -1.244997 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] 0.6833101 1.036919 0.4482321 -0.356907 -0.725137 -0.526155 -0.7145956 [2,] 0.6833101 1.036919 0.4482321 -0.356907 -0.725137 -0.526155 -0.7145956 [,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57] [1,] 0.6590045 0.0357361 1.385851 -1.274743 1.0476 0.5777915 -2.327155 0.766313 [2,] 0.6590045 0.0357361 1.385851 -1.274743 1.0476 0.5777915 -2.327155 0.766313 [,58] [,59] [,60] [,61] [,62] [,63] [,64] [1,] -1.218671 -0.2081731 -2.33136 1.074699 0.4058281 0.5857224 -0.5567445 [2,] -1.218671 -0.2081731 -2.33136 1.074699 0.4058281 0.5857224 -0.5567445 [,65] [,66] [,67] [,68] [,69] [,70] [,71] [1,] 1.033513 2.122401 -1.43629 0.7623296 -2.309295 -0.3773282 -1.948627 [2,] 1.033513 2.122401 -1.43629 0.7623296 -2.309295 -0.3773282 -1.948627 [,72] [,73] [,74] [,75] [,76] [,77] [,78] [1,] 0.7316199 1.18108 0.8865782 1.21477 -0.001105591 -1.107645 0.2980017 [2,] 0.7316199 1.18108 0.8865782 1.21477 -0.001105591 -1.107645 0.2980017 [,79] [,80] [,81] [,82] [,83] [,84] [,85] [1,] 2.997553 -1.795363 2.114483 -1.905343 -0.9613664 1.288088 1.126283 [2,] 2.997553 -1.795363 2.114483 -1.905343 -0.9613664 1.288088 1.126283 [,86] [,87] [,88] [,89] [,90] [,91] [,92] [1,] 1.620296 1.191742 -0.5348034 0.6870664 -0.2946642 0.2773927 0.8163442 [2,] 1.620296 1.191742 -0.5348034 0.6870664 -0.2946642 0.2773927 0.8163442 [,93] [,94] [,95] [,96] [,97] [,98] [,99] [1,] -1.916078 -0.008852292 -0.1833807 -0.410889 -0.7474848 1.026954 0.8421821 [2,] -1.916078 -0.008852292 -0.1833807 -0.410889 -0.7474848 1.026954 0.8421821 [,100] [1,] 0.590061 [2,] 0.590061 > > > Max(tmp2) [1] 1.680168 > Min(tmp2) [1] -3.289875 > mean(tmp2) [1] -0.2074433 > Sum(tmp2) [1] -20.74433 > Var(tmp2) [1] 0.8908689 > > rowMeans(tmp2) [1] -0.024222615 -1.350573260 -0.329318249 0.676454465 0.391702943 [6] -0.058784556 -1.272584781 -1.190705108 -0.162471639 -0.209082177 [11] -0.541734438 -0.264437248 0.197483218 0.409669323 -0.045160229 [16] 1.180412887 1.487197126 1.255178925 0.444033966 -0.636087016 [21] -1.858148246 1.068051393 0.158397113 -0.721362059 -0.019977523 [26] -0.869413676 0.135039145 -0.724000382 -0.853556940 -1.403187388 [31] 1.042286455 -0.862528915 0.188670509 0.609417083 0.668397979 [36] -0.275847969 0.916792952 -0.195762135 -1.189301960 -0.190512376 [41] 1.176960446 1.110505010 1.240065963 0.845699632 -1.405391724 [46] -0.722217598 0.100437454 -0.310971150 -1.092703596 -0.764756836 [51] -0.526811069 -3.289875477 0.832594303 0.476628561 0.009184946 [56] -0.401811866 0.743563014 0.917453600 0.147718193 0.057429998 [61] -0.921632059 -0.186658725 0.690582844 -1.661045098 1.534836299 [66] -0.569020016 1.680168288 0.561386074 -0.854192584 -0.504481838 [71] -1.152810450 -0.611153904 -2.766850363 0.389258009 0.305774056 [76] -0.674823539 -0.719449008 0.203404068 0.354741657 -0.375231012 [81] -1.354704384 -0.999620248 0.294485775 -0.074958756 1.136932220 [86] -0.765380295 -1.138246373 -0.161279903 -0.149437651 -0.350428920 [91] 0.077924084 0.695789137 -1.066640891 -1.381459028 -1.157977795 [96] -0.334109049 0.381448516 0.526692922 -1.755477122 -2.614808167 > rowSums(tmp2) [1] -0.024222615 -1.350573260 -0.329318249 0.676454465 0.391702943 [6] -0.058784556 -1.272584781 -1.190705108 -0.162471639 -0.209082177 [11] -0.541734438 -0.264437248 0.197483218 0.409669323 -0.045160229 [16] 1.180412887 1.487197126 1.255178925 0.444033966 -0.636087016 [21] -1.858148246 1.068051393 0.158397113 -0.721362059 -0.019977523 [26] -0.869413676 0.135039145 -0.724000382 -0.853556940 -1.403187388 [31] 1.042286455 -0.862528915 0.188670509 0.609417083 0.668397979 [36] -0.275847969 0.916792952 -0.195762135 -1.189301960 -0.190512376 [41] 1.176960446 1.110505010 1.240065963 0.845699632 -1.405391724 [46] -0.722217598 0.100437454 -0.310971150 -1.092703596 -0.764756836 [51] -0.526811069 -3.289875477 0.832594303 0.476628561 0.009184946 [56] -0.401811866 0.743563014 0.917453600 0.147718193 0.057429998 [61] -0.921632059 -0.186658725 0.690582844 -1.661045098 1.534836299 [66] -0.569020016 1.680168288 0.561386074 -0.854192584 -0.504481838 [71] -1.152810450 -0.611153904 -2.766850363 0.389258009 0.305774056 [76] -0.674823539 -0.719449008 0.203404068 0.354741657 -0.375231012 [81] -1.354704384 -0.999620248 0.294485775 -0.074958756 1.136932220 [86] -0.765380295 -1.138246373 -0.161279903 -0.149437651 -0.350428920 [91] 0.077924084 0.695789137 -1.066640891 -1.381459028 -1.157977795 [96] -0.334109049 0.381448516 0.526692922 -1.755477122 -2.614808167 > rowVars(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowSd(tmp2) [1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [26] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [51] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA [76] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA > rowMax(tmp2) [1] -0.024222615 -1.350573260 -0.329318249 0.676454465 0.391702943 [6] -0.058784556 -1.272584781 -1.190705108 -0.162471639 -0.209082177 [11] -0.541734438 -0.264437248 0.197483218 0.409669323 -0.045160229 [16] 1.180412887 1.487197126 1.255178925 0.444033966 -0.636087016 [21] -1.858148246 1.068051393 0.158397113 -0.721362059 -0.019977523 [26] -0.869413676 0.135039145 -0.724000382 -0.853556940 -1.403187388 [31] 1.042286455 -0.862528915 0.188670509 0.609417083 0.668397979 [36] -0.275847969 0.916792952 -0.195762135 -1.189301960 -0.190512376 [41] 1.176960446 1.110505010 1.240065963 0.845699632 -1.405391724 [46] -0.722217598 0.100437454 -0.310971150 -1.092703596 -0.764756836 [51] -0.526811069 -3.289875477 0.832594303 0.476628561 0.009184946 [56] -0.401811866 0.743563014 0.917453600 0.147718193 0.057429998 [61] -0.921632059 -0.186658725 0.690582844 -1.661045098 1.534836299 [66] -0.569020016 1.680168288 0.561386074 -0.854192584 -0.504481838 [71] -1.152810450 -0.611153904 -2.766850363 0.389258009 0.305774056 [76] -0.674823539 -0.719449008 0.203404068 0.354741657 -0.375231012 [81] -1.354704384 -0.999620248 0.294485775 -0.074958756 1.136932220 [86] -0.765380295 -1.138246373 -0.161279903 -0.149437651 -0.350428920 [91] 0.077924084 0.695789137 -1.066640891 -1.381459028 -1.157977795 [96] -0.334109049 0.381448516 0.526692922 -1.755477122 -2.614808167 > rowMin(tmp2) [1] -0.024222615 -1.350573260 -0.329318249 0.676454465 0.391702943 [6] -0.058784556 -1.272584781 -1.190705108 -0.162471639 -0.209082177 [11] -0.541734438 -0.264437248 0.197483218 0.409669323 -0.045160229 [16] 1.180412887 1.487197126 1.255178925 0.444033966 -0.636087016 [21] -1.858148246 1.068051393 0.158397113 -0.721362059 -0.019977523 [26] -0.869413676 0.135039145 -0.724000382 -0.853556940 -1.403187388 [31] 1.042286455 -0.862528915 0.188670509 0.609417083 0.668397979 [36] -0.275847969 0.916792952 -0.195762135 -1.189301960 -0.190512376 [41] 1.176960446 1.110505010 1.240065963 0.845699632 -1.405391724 [46] -0.722217598 0.100437454 -0.310971150 -1.092703596 -0.764756836 [51] -0.526811069 -3.289875477 0.832594303 0.476628561 0.009184946 [56] -0.401811866 0.743563014 0.917453600 0.147718193 0.057429998 [61] -0.921632059 -0.186658725 0.690582844 -1.661045098 1.534836299 [66] -0.569020016 1.680168288 0.561386074 -0.854192584 -0.504481838 [71] -1.152810450 -0.611153904 -2.766850363 0.389258009 0.305774056 [76] -0.674823539 -0.719449008 0.203404068 0.354741657 -0.375231012 [81] -1.354704384 -0.999620248 0.294485775 -0.074958756 1.136932220 [86] -0.765380295 -1.138246373 -0.161279903 -0.149437651 -0.350428920 [91] 0.077924084 0.695789137 -1.066640891 -1.381459028 -1.157977795 [96] -0.334109049 0.381448516 0.526692922 -1.755477122 -2.614808167 > > colMeans(tmp2) [1] -0.2074433 > colSums(tmp2) [1] -20.74433 > colVars(tmp2) [1] 0.8908689 > colSd(tmp2) [1] 0.9438585 > colMax(tmp2) [1] 1.680168 > colMin(tmp2) [1] -3.289875 > colMedians(tmp2) [1] -0.1745652 > colRanges(tmp2) [,1] [1,] -3.289875 [2,] 1.680168 > > 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.0040917 0.5399471 2.8879368 -1.1875303 -0.2516123 -4.7688163 [7] -1.9204529 1.8530182 -1.0043532 1.0425374 > colApply(tmp,quantile)[,1] [,1] [1,] -1.9911467 [2,] -0.2265721 [3,] 0.1013641 [4,] 0.6855816 [5,] 1.2200266 > > rowApply(tmp,sum) [1] -4.7366636 -0.6643924 1.7276054 -3.5481252 -1.7048879 1.9711979 [7] -5.6758256 6.3874025 5.5333126 -1.0948576 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1 8 9 6 6 4 9 4 7 6 [2,] 9 2 8 8 10 2 5 2 8 4 [3,] 10 4 2 10 1 6 8 8 1 9 [4,] 3 7 3 3 9 9 4 3 4 7 [5,] 6 6 5 7 5 7 6 1 2 8 [6,] 7 3 6 5 2 3 1 7 3 3 [7,] 5 10 10 1 7 1 3 6 9 1 [8,] 4 9 7 4 8 8 2 10 10 2 [9,] 8 5 1 2 4 10 7 5 6 5 [10,] 2 1 4 9 3 5 10 9 5 10 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 1.8631063 -2.9029874 -4.9663096 -0.6864733 -3.0300550 -3.8431759 [7] 2.8519150 0.4152151 -4.4086161 3.6039405 -2.4907077 -0.1709216 [13] 0.6129135 2.0878430 -3.1448337 2.4231749 -3.1846236 3.4080002 [19] -0.2264033 -2.1022298 > colApply(tmp,quantile)[,1] [,1] [1,] -0.2383368 [2,] -0.1918410 [3,] 0.0518528 [4,] 0.5685838 [5,] 1.6728476 > > rowApply(tmp,sum) [1] 1.948334 -1.053595 -3.102666 -8.428621 -3.254679 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 20 12 9 20 12 [2,] 9 3 12 9 5 [3,] 6 8 7 1 1 [4,] 18 4 18 14 3 [5,] 5 11 5 4 6 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 1.6728476 -0.1347209 -0.2033569 0.7723065 -0.29708000 0.3308415 [2,] 0.0518528 -1.2321529 -0.2188504 -1.2197085 0.01515976 -0.2479122 [3,] -0.2383368 0.2095562 -0.4636268 0.5879935 -0.70717197 -0.5255340 [4,] 0.5685838 -0.5876838 -2.6503832 0.3922593 -1.07011843 -2.5306928 [5,] -0.1918410 -1.1579861 -1.4300923 -1.2193241 -0.97084436 -0.8698784 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -0.1702925 1.26188769 -0.9489144 0.03679853 0.07359452 0.2579622 [2,] 1.8657981 -0.05262976 -2.4078632 1.38803964 0.25948099 -0.6267655 [3,] 1.2639976 -0.00980097 -1.9532599 0.23451225 0.40811692 0.1867990 [4,] 0.1733576 -0.18640600 -0.2840535 -0.69992082 -1.81510835 0.5168711 [5,] -0.2809458 -0.59783582 1.1854749 2.64451086 -1.41679182 -0.5057884 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -0.09589322 -0.186481383 -0.47867403 -0.3969112 0.5908161 -0.06179574 [2,] 0.61256916 1.390127829 -0.97035686 1.0128340 -1.9273185 0.91498460 [3,] -0.45749995 0.453957312 -1.08262716 0.3366372 -0.8061148 0.73987066 [4,] 0.01063291 0.438341841 -0.69930540 0.5410734 -0.8298785 0.48316899 [5,] 0.54310462 -0.008102576 0.08612976 0.9295415 -0.2121280 1.33177170 [,19] [,20] [1,] 0.36158397 -0.43618482 [2,] -0.08619545 0.42531157 [3,] 0.28737462 -1.56750924 [4,] 0.39721532 -0.59657496 [5,] -1.18638171 0.07272761 > > > 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 : 654 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 567 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 -2.069749 -1.892665 0.5817779 1.61105 -0.6437769 0.5799495 -0.8010421 col8 col9 col10 col11 col12 col13 col14 row1 -0.9038702 -0.452208 -0.3119408 0.066039 -0.9605222 -0.1342416 -0.9740353 col15 col16 col17 col18 col19 col20 row1 2.053361 -2.720867 1.551802 1.054774 0.03761611 0.7268541 > tmp[,"col10"] col10 row1 -0.3119408 row2 1.0204304 row3 -0.4203572 row4 1.8354621 row5 0.3889916 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 -2.0697493 -1.8926645 0.5817779 1.6110495 -0.6437769 0.5799495 row5 -0.4933849 -0.1206819 -1.8543607 0.2062165 0.3111843 -0.2256741 col7 col8 col9 col10 col11 col12 row1 -0.8010421 -0.9038702 -0.452208 -0.3119408 0.0660390 -0.9605222 row5 -0.2315265 -0.2306906 -1.338823 0.3889916 -0.2641031 -1.1966479 col13 col14 col15 col16 col17 col18 row1 -0.1342416 -0.9740353 2.0533615 -2.7208665 1.5518016 1.0547738 row5 0.1598749 0.6022203 -0.4364921 0.4379415 0.7252312 0.4408944 col19 col20 row1 0.03761611 0.7268541 row5 -0.76581587 0.3241458 > tmp[,c("col6","col20")] col6 col20 row1 0.5799495 0.7268541 row2 -1.7266220 0.7682851 row3 0.2120790 0.1292327 row4 -0.5266907 -0.1982658 row5 -0.2256741 0.3241458 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 0.5799495 0.7268541 row5 -0.2256741 0.3241458 > > > > > 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.81374 51.44823 49.26223 49.14938 48.92236 105.6484 50.3633 48.57774 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.00414 50.57042 49.73955 50.24571 50.14958 50.70569 49.6448 49.66529 col17 col18 col19 col20 row1 50.4626 49.19912 51.223 104.9139 > tmp[,"col10"] col10 row1 50.57042 row2 31.05916 row3 29.40308 row4 31.08371 row5 51.44715 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 49.81374 51.44823 49.26223 49.14938 48.92236 105.6484 50.36330 48.57774 row5 50.92469 48.92313 50.03961 50.53019 51.84972 105.1336 50.39535 49.54669 col9 col10 col11 col12 col13 col14 col15 col16 row1 49.00414 50.57042 49.73955 50.24571 50.14958 50.70569 49.64480 49.66529 row5 52.20658 51.44715 47.62796 51.28517 52.22782 49.45900 52.23931 50.21320 col17 col18 col19 col20 row1 50.46260 49.19912 51.22300 104.9139 row5 49.50319 49.59128 50.34412 105.9178 > tmp[,c("col6","col20")] col6 col20 row1 105.64845 104.91386 row2 75.59525 75.27549 row3 75.02885 76.65100 row4 75.85387 75.81588 row5 105.13357 105.91781 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 105.6484 104.9139 row5 105.1336 105.9178 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 105.6484 104.9139 row5 105.1336 105.9178 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] 0.5597961 [2,] -0.3282904 [3,] -1.1268323 [4,] 3.8325758 [5,] -0.7913578 > tmp[,c("col17","col7")] col17 col7 [1,] -1.1796245 0.27164925 [2,] 0.4985204 0.06231469 [3,] 0.3705550 0.86505729 [4,] 0.1150297 -0.42560803 [5,] 0.2206561 -1.98697861 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] 0.61349771 -0.3324337 [2,] 0.01030477 -0.5285601 [3,] -0.39595137 1.7042141 [4,] 0.80619763 0.2735903 [5,] 0.54642380 -1.0931908 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] 0.6134977 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] 0.61349771 [2,] 0.01030477 > > > > 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.38509227 -0.5766828 1.9185352 0.8686268 -0.5093056 -0.8570271 row1 0.06806874 -0.7184319 -0.4883586 -0.3776311 -1.2522047 1.1007039 [,7] [,8] [,9] [,10] [,11] [,12] [,13] row3 1.107920 0.4713556 0.1317186 1.088001 -0.5895118 -0.5385956 -1.224014 row1 0.591736 0.4520841 1.6794181 1.203000 -1.9938879 0.8561759 -1.531216 [,14] [,15] [,16] [,17] [,18] [,19] [,20] row3 0.243549 -0.7662689 -1.91475841 1.0431028 -0.4008610 0.01910426 0.6533854 row1 2.278305 -0.6704271 0.06933421 0.3465199 0.1076752 0.75469256 -0.4596156 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 0.6988467 0.2473633 -0.263726 -0.7404641 0.7327096 -1.147936 0.07640568 [,8] [,9] [,10] row2 1.13749 0.159302 -0.9140115 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -1.355381 -2.732444 0.3261427 0.6213034 -0.9767162 1.249993 0.4688637 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -1.692286 0.5757708 0.9042194 -1.549224 -0.6722288 -0.01448027 0.4239232 [,15] [,16] [,17] [,18] [,19] [,20] row5 -1.602408 -1.660484 0.468551 -1.544765 0.2493217 -0.5084813 > > > 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: 0x6000007c86c0> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f9450393" [2] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f11edaca6" [3] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2fae1cf7c" [4] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f6efcdb78" [5] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f1aacdc35" [6] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f4aad2941" [7] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f2e6f90b4" [8] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f1e85313d" [9] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f3a63ab72" [10] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f658ce750" [11] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f5a66946" [12] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f7049758f" [13] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f66c538e0" [14] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f1e192ed6" [15] "/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests/BM16a2f751f30a" > > > ### 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: 0x6000007c9260> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x6000007c9260> Warning message: In dir.create(new.directory) : '/Users/biocbuild/bbs-3.20-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x6000007c9260> > rowMedians(tmp) [1] 0.365082788 -0.210026924 -0.066413085 0.297817693 0.397588335 [6] -0.178295341 -0.280781307 0.565481296 0.157225275 0.029713500 [11] -0.187296049 -0.443902576 -0.130357022 -0.059380208 0.198685836 [16] 0.162114430 -0.343490590 0.062414947 -0.187151439 0.155231846 [21] -0.157022262 -0.011943264 0.492846727 0.464930758 0.451728737 [26] 0.610336560 -0.174102765 -0.236222757 -0.701402371 0.314558480 [31] 0.511715835 0.305052563 -0.191338474 0.125133663 -0.008415120 [36] 0.042695845 -0.062103588 0.677617555 -0.316325365 -0.267536031 [41] 0.340261337 -0.144151665 -0.345675657 -0.199970316 0.168348500 [46] 0.618461785 0.676141701 0.211464768 -0.170483594 -0.644426867 [51] 0.013863303 -0.321733136 0.006423447 -0.304912575 0.103293878 [56] -0.115599813 -0.567313024 0.314780097 -0.381498647 -0.217103427 [61] 0.693469934 -0.069339299 0.036307357 -0.320534356 -0.119567370 [66] 0.138239369 0.020224165 0.039248551 0.490138232 -0.529994718 [71] 0.288803676 0.169266404 -0.113174295 -0.107455927 0.359818186 [76] -0.085764584 -0.402830383 0.264731056 0.295603398 0.009135639 [81] -0.304923265 -0.272800304 0.100819615 -0.020052042 0.045787233 [86] 0.251196879 0.763993362 -0.001580221 -0.201398981 0.401846975 [91] -0.222246071 0.129276978 -0.050907855 -0.185707135 -0.316710106 [96] -0.485260077 0.201109230 0.120648347 -0.034437347 0.181877087 [101] 0.283861886 -0.101326103 0.348678200 -0.156421834 -0.023247934 [106] -0.036185201 -0.361444008 0.537187728 -0.145174010 -0.023330760 [111] 0.216756995 0.027301228 -0.425482720 0.115433102 0.168348714 [116] 0.096337030 -0.269049860 0.178257413 -0.373269392 -0.734481518 [121] -0.037248237 0.217115207 -0.241204262 0.240939729 0.256670475 [126] -0.194124544 -0.230193939 -0.177034773 0.162307829 0.117780352 [131] 0.023377410 -0.195333069 0.308091385 -0.006171118 0.422926694 [136] -0.127641169 -0.267693308 -0.297816898 0.247958845 0.387482059 [141] 0.044961517 0.229220368 0.115959093 -0.484479137 0.130476285 [146] 0.368442880 -0.302042547 0.253198104 0.282256367 0.093960024 [151] 0.129826222 0.141513389 -0.366525279 -0.759884746 0.199960622 [156] -0.164428918 0.389299177 0.784468870 -0.142663175 -0.066971465 [161] 0.543772480 0.469812423 0.013562957 0.243505281 -0.055379107 [166] -0.622734706 0.108869740 0.214206173 0.236028603 0.112363595 [171] 0.207586050 0.285594256 -0.306960060 0.355890657 -0.070164996 [176] 0.206578810 0.003847667 0.173453055 -0.161364403 -0.528358208 [181] 0.286142536 -0.112375352 -0.005391156 -0.178177616 0.040770104 [186] 0.246247527 0.254467341 0.019404059 0.414960851 0.465613194 [191] 0.533993941 0.030573521 -0.298915089 0.610081514 -0.123216075 [196] 0.316918380 0.837730835 -0.227093570 -0.117574182 0.150755424 [201] -0.278508481 -0.311726434 -0.270894201 -0.328144615 -0.470846496 [206] 0.141264481 0.200919757 -0.214987404 0.338843895 0.222444975 [211] 0.270339642 0.115500341 0.701832210 -0.389487991 -0.023660851 [216] 0.176248239 -0.030358793 -0.185368680 0.468667950 0.260617853 [221] -0.012555108 0.054110502 0.091937075 0.321931163 -0.407517487 [226] -0.307190217 -0.655918440 -0.135361995 0.326372883 0.291837998 > > proc.time() user system elapsed 0.563 2.697 3.266
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: 0x600001c58660> > .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: 0x600001c58660> > .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: 0x600001c58660> > .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: 0x600001c58660> > 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: 0x600001c58de0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c58de0> > .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: 0x600001c58de0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c58de0> > .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: 0x600001c58de0> > 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: 0x600001c58fc0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c58fc0> > .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: 0x600001c58fc0> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001c58fc0> > .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: 0x600001c58fc0> > > .Call("R_bm_RowMode",P) <pointer: 0x600001c58fc0> > .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: 0x600001c58fc0> > > .Call("R_bm_ColMode",P) <pointer: 0x600001c58fc0> > .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: 0x600001c58fc0> > 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: 0x600001c591a0> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0x600001c591a0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c591a0> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c591a0> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile16a5e2ff06af" "BufferedMatrixFile16a5e350fccb2" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile16a5e2ff06af" "BufferedMatrixFile16a5e350fccb2" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0x600001c59440> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c59440> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001c59440> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0x600001c59440> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0x600001c59440> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0x600001c59440> > .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: 0x600001c59620> > .Call("R_bm_AddColumn",P) <pointer: 0x600001c59620> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0x600001c59620> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0x600001c59620> > 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: 0x600001c59800> > .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: 0x600001c59800> > rm(P) > > proc.time() user system elapsed 0.105 0.034 0.134
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.018 0.123