Back to Multiple platform build/check report for BioC 3.21: simplified long |
|
This page was generated on 2025-01-28 11:47 -0500 (Tue, 28 Jan 2025).
Hostname | OS | Arch (*) | R version | Installed pkgs |
---|---|---|---|---|
nebbiolo1 | Linux (Ubuntu 24.04.1 LTS) | x86_64 | R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" | 4659 |
palomino7 | Windows Server 2022 Datacenter | x64 | R Under development (unstable) (2025-01-21 r87610 ucrt) -- "Unsuffered Consequences" | 4454 |
lconway | macOS 12.7.1 Monterey | x86_64 | R Under development (unstable) (2025-01-22 r87618) -- "Unsuffered Consequences" | 4465 |
kjohnson3 | macOS 13.7.1 Ventura | arm64 | R Under development (unstable) (2025-01-20 r87609) -- "Unsuffered Consequences" | 4419 |
kunpeng2 | Linux (openEuler 22.03 LTS-SP1) | aarch64 | R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" | 4409 |
Click on any hostname to see more info about the system (e.g. compilers) (*) as reported by 'uname -p', except on Windows and Mac OS X |
Package 246/2286 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
BufferedMatrix 1.71.1 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.1 LTS) / x86_64 | OK | OK | OK | |||||||||
palomino7 | Windows Server 2022 Datacenter / x64 | OK | OK | OK | OK | |||||||||
lconway | macOS 12.7.1 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
kjohnson3 | macOS 13.7.1 Ventura / arm64 | OK | OK | WARNINGS | OK | |||||||||
kunpeng2 | Linux (openEuler 22.03 LTS-SP1) / aarch64 | OK | OK | OK | ||||||||||
To the developers/maintainers of the BufferedMatrix package: - Allow up to 24 hours (and sometimes 48 hours) for your latest push to git@git.bioconductor.org:packages/BufferedMatrix.git to reflect on this report. See Troubleshooting Build Report for more information. - Use the following Renviron settings to reproduce errors and warnings. - If 'R CMD check' started to fail recently on the Linux builder(s) over a missing dependency, add the missing dependency to 'Suggests:' in your DESCRIPTION file. See Renviron.bioc for more information. - See Martin Grigorov's blog post for how to debug Linux ARM64 related issues on a x86_64 host. |
Package: BufferedMatrix |
Version: 1.71.1 |
Command: /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz |
StartedAt: 2025-01-28 08:48:19 -0000 (Tue, 28 Jan 2025) |
EndedAt: 2025-01-28 08:48:43 -0000 (Tue, 28 Jan 2025) |
EllapsedTime: 24.0 seconds |
RetCode: 0 |
Status: OK |
CheckDir: BufferedMatrix.Rcheck |
Warnings: 0 |
############################################################################## ############################################################################## ### ### Running command: ### ### /home/biocbuild/R/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/R/R/site-library --no-vignettes --timings BufferedMatrix_1.71.1.tar.gz ### ############################################################################## ############################################################################## * using log directory ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck’ * using R Under development (unstable) (2024-11-24 r87369) * using platform: aarch64-unknown-linux-gnu * R was compiled by aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0 GNU Fortran (GCC) 14.2.0 * running under: openEuler 24.03 (LTS) * using session charset: UTF-8 * using option ‘--no-vignettes’ * checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK * this is package ‘BufferedMatrix’ version ‘1.71.1’ * checking package namespace information ... OK * checking package dependencies ... OK * checking if this is a source package ... OK * checking if there is a namespace ... OK * checking for hidden files and directories ... OK * checking for portable file names ... OK * checking for sufficient/correct file permissions ... OK * checking whether package ‘BufferedMatrix’ can be installed ... OK * used C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’ * 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 loading without being on the library search path ... 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 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: 2 NOTEs See ‘/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/00check.log’ for details.
BufferedMatrix.Rcheck/00install.out
############################################################################## ############################################################################## ### ### Running command: ### ### /home/biocbuild/R/R/bin/R CMD INSTALL BufferedMatrix ### ############################################################################## ############################################################################## * installing to library ‘/home/biocbuild/R/R-4.5.0-devel_2024-11-24/site-library’ * installing *source* package ‘BufferedMatrix’ ... ** using staged installation ** libs using C compiler: ‘aarch64-unknown-linux-gnu-gcc (GCC) 14.2.0’ /opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o /opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’: doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses] 1580 | if (!(Matrix->readonly) & setting){ | ^~~~~~~~~~~~~~~~~~~ doubleBufferedMatrix.c: At top level: doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function] 3327 | static int sort_double(const double *a1,const double *a2){ | ^~~~~~~~~~~ /opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o /opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -I"/home/biocbuild/R/R/include" -DNDEBUG -I/usr/local/include -fPIC -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o /opt/ohpc/pub/compiler/gcc/14.2.0/bin/aarch64-unknown-linux-gnu-gcc -shared -L/home/biocbuild/R/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R/lib -lR installing to /home/biocbuild/R/R-4.5.0-devel_2024-11-24/site-library/00LOCK-BufferedMatrix/00new/BufferedMatrix/libs ** R ** inst ** byte-compile and prepare package for lazy loading Creating a new generic function for ‘rowMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘rowSums’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colMeans’ in package ‘BufferedMatrix’ Creating a new generic function for ‘colSums’ in package ‘BufferedMatrix’ Creating a generic function for ‘ncol’ from package ‘base’ in package ‘BufferedMatrix’ Creating a generic function for ‘nrow’ from package ‘base’ in package ‘BufferedMatrix’ ** help *** installing help indices ** building package indices ** installing vignettes ** testing if installed package can be loaded from temporary location ** checking absolute paths in shared objects and dynamic libraries ** testing if installed package can be loaded from final location ** testing if installed package keeps a record of temporary installation path * DONE (BufferedMatrix)
BufferedMatrix.Rcheck/tests/c_code_level_tests.Rout
R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-unknown-linux-gnu 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.345 0.017 0.348
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-unknown-linux-gnu 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] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests" > prefix(tmp3) [1] "BM" > > ## testing if we can remove these objects > rm(tmp, tmp2, tmp3) > gc() used (Mb) gc trigger (Mb) max used (Mb) Ncells 478192 25.6 1046321 55.9 639882 34.2 Vcells 884352 6.8 8388608 64.0 2080652 15.9 > > > > > ## > ## checking reads > ## > > tmp2 <- createBufferedMatrix(10,20) > > test.sample <- rnorm(10*20) > > tmp2[1:10,1:20] <- test.sample > > test.matrix <- matrix(test.sample,10,20) > > ## testing reads > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Tue Jan 28 08:48:37 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Tue Jan 28 08:48:37 2025" > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > > > RowMode(tmp2) <pointer: 0x3d580460> > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + which.col <- sample(1:20,1) + if (tmp2[which.row,which.col] != test.matrix[which.row,which.col]){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.row <- sample(1:10,1) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > for (rep in 1:nreps){ + which.col <- sample(1:20,1) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[,which.col] == test.matrix[,which.col])){ + cat("incorrect agreement") + break; + } + } > > > > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + if (!all(tmp2[which.row,] == test.matrix[which.row,])){ + cat("incorrect agreement") + break; + } + } > > > date() [1] "Tue Jan 28 08:48:37 2025" > for (rep in 1:nreps){ + which.row <- sample(1:10,5,replace=TRUE) + which.col <- sample(1:20,5,replace=TRUE) + if (!all(tmp2[which.row,which.col] == test.matrix[which.row,which.col])){ + cat("incorrect agreement") + break; + } + } > date() [1] "Tue Jan 28 08:48:38 2025" > > ColMode(tmp2) <pointer: 0x3d580460> > > > > ### 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,] 98.73658502 -0.57384238 1.1097330 -0.21676171 [2,] -0.70685355 -0.05337526 -0.2581994 0.08340664 [3,] -0.22646116 0.68843394 0.7342212 -0.89740138 [4,] 0.03259353 0.97946515 2.4879393 -0.82392845 > ewApply(tmp5,abs) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-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,] 98.73658502 0.57384238 1.1097330 0.21676171 [2,] 0.70685355 0.05337526 0.2581994 0.08340664 [3,] 0.22646116 0.68843394 0.7342212 0.89740138 [4,] 0.03259353 0.97946515 2.4879393 0.82392845 > ewApply(tmp5,sqrt) BufferedMatrix object Matrix size: 10 20 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 2 Kilobytes. Disk usage : 1.6 Kilobytes. > tmp5[1:4,1:4] [,1] [,2] [,3] [,4] [1,] 9.9366285 0.7575238 1.0534386 0.4655767 [2,] 0.8407458 0.2310309 0.5081332 0.2888021 [3,] 0.4758794 0.8297192 0.8568671 0.9473127 [4,] 0.1805368 0.9896793 1.5773203 0.9077050 > > 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: /home/biocbuild/bbs-3.21-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,] 223.10287 33.14908 36.64412 29.87253 [2,] 34.11431 27.36368 30.33953 27.97143 [3,] 29.98525 33.98563 34.30289 35.37053 [4,] 26.83796 35.87626 43.26114 34.90098 > > > > ## testing functions that elementwise transform the matrix > sqrt(tmp5) <pointer: 0x3d3c5410> > exp(tmp5) <pointer: 0x3d3c5410> > log(tmp5,2) <pointer: 0x3d3c5410> > pow(tmp5,2) > > > > > > ## testing functions that apply to entire matrix > Max(tmp5) [1] 464.3594 > Min(tmp5) [1] 52.42317 > mean(tmp5) [1] 72.27502 > Sum(tmp5) [1] 14455 > Var(tmp5) [1] 852.4828 > > > ## testing functions applied to rows or columns > > rowMeans(tmp5) [1] 89.06350 69.20297 72.02897 72.51328 67.07439 70.97690 72.41568 70.80696 [9] 70.36090 68.30667 > rowSums(tmp5) [1] 1781.270 1384.059 1440.579 1450.266 1341.488 1419.538 1448.314 1416.139 [9] 1407.218 1366.133 > rowVars(tmp5) [1] 7862.39820 74.38876 71.17867 62.37767 92.93293 75.61868 [7] 85.17504 87.73499 82.96540 74.15327 > rowSd(tmp5) [1] 88.670165 8.624892 8.436745 7.897953 9.640173 8.695900 9.229032 [8] 9.366696 9.108535 8.611229 > rowMax(tmp5) [1] 464.35939 85.72407 86.15828 90.04240 85.95791 87.86185 91.23461 [8] 89.29302 85.03118 88.03103 > rowMin(tmp5) [1] 59.05351 56.45256 56.49335 55.85970 52.42317 56.14386 52.69782 57.10235 [9] 54.86795 57.32980 > > colMeans(tmp5) [1] 109.87108 69.36407 71.25745 66.28384 67.53924 75.05674 71.67881 [8] 70.51994 73.48270 64.31367 70.04718 71.25576 70.00863 66.03127 [15] 73.78779 72.30604 70.36314 64.32280 74.53101 73.47931 > colSums(tmp5) [1] 1098.7108 693.6407 712.5745 662.8384 675.3924 750.5674 716.7881 [8] 705.1994 734.8270 643.1367 700.4718 712.5576 700.0863 660.3127 [15] 737.8779 723.0604 703.6314 643.2280 745.3101 734.7931 > colVars(tmp5) [1] 15641.62281 73.40730 80.44975 30.05012 82.96504 59.26212 [7] 81.82285 85.78983 103.01376 79.72074 69.06772 58.84012 [13] 29.01763 59.93834 25.52752 90.06457 120.30358 81.88011 [19] 63.58514 62.83936 > colSd(tmp5) [1] 125.066474 8.567806 8.969378 5.481799 9.108515 7.698190 [7] 9.045599 9.262280 10.149570 8.928647 8.310699 7.670731 [13] 5.386801 7.741986 5.052476 9.490236 10.968299 9.048763 [19] 7.974029 7.927128 > colMax(tmp5) [1] 464.35939 83.77597 90.04240 73.61912 81.87255 85.66061 86.29941 [8] 87.86185 85.72407 81.60998 86.15828 80.49368 79.40051 79.50804 [15] 80.46105 85.95791 89.29302 79.23129 88.03103 81.35120 > colMin(tmp5) [1] 55.85970 56.65220 61.31634 58.21886 55.80451 65.63316 59.05351 56.80017 [9] 60.84571 55.47826 60.03571 59.83429 61.12984 52.69782 64.72250 54.86795 [17] 55.83838 52.42317 63.16917 57.32980 > > > ### 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] 89.06350 69.20297 72.02897 72.51328 NA 70.97690 72.41568 70.80696 [9] 70.36090 68.30667 > rowSums(tmp5) [1] 1781.270 1384.059 1440.579 1450.266 NA 1419.538 1448.314 1416.139 [9] 1407.218 1366.133 > rowVars(tmp5) [1] 7862.39820 74.38876 71.17867 62.37767 89.25147 75.61868 [7] 85.17504 87.73499 82.96540 74.15327 > rowSd(tmp5) [1] 88.670165 8.624892 8.436745 7.897953 9.447300 8.695900 9.229032 [8] 9.366696 9.108535 8.611229 > rowMax(tmp5) [1] 464.35939 85.72407 86.15828 90.04240 NA 87.86185 91.23461 [8] 89.29302 85.03118 88.03103 > rowMin(tmp5) [1] 59.05351 56.45256 56.49335 55.85970 NA 56.14386 52.69782 57.10235 [9] 54.86795 57.32980 > > colMeans(tmp5) [1] 109.87108 69.36407 71.25745 66.28384 67.53924 75.05674 71.67881 [8] 70.51994 73.48270 64.31367 70.04718 71.25576 70.00863 NA [15] 73.78779 72.30604 70.36314 64.32280 74.53101 73.47931 > colSums(tmp5) [1] 1098.7108 693.6407 712.5745 662.8384 675.3924 750.5674 716.7881 [8] 705.1994 734.8270 643.1367 700.4718 712.5576 700.0863 NA [15] 737.8779 723.0604 703.6314 643.2280 745.3101 734.7931 > colVars(tmp5) [1] 15641.62281 73.40730 80.44975 30.05012 82.96504 59.26212 [7] 81.82285 85.78983 103.01376 79.72074 69.06772 58.84012 [13] 29.01763 NA 25.52752 90.06457 120.30358 81.88011 [19] 63.58514 62.83936 > colSd(tmp5) [1] 125.066474 8.567806 8.969378 5.481799 9.108515 7.698190 [7] 9.045599 9.262280 10.149570 8.928647 8.310699 7.670731 [13] 5.386801 NA 5.052476 9.490236 10.968299 9.048763 [19] 7.974029 7.927128 > colMax(tmp5) [1] 464.35939 83.77597 90.04240 73.61912 81.87255 85.66061 86.29941 [8] 87.86185 85.72407 81.60998 86.15828 80.49368 79.40051 NA [15] 80.46105 85.95791 89.29302 79.23129 88.03103 81.35120 > colMin(tmp5) [1] 55.85970 56.65220 61.31634 58.21886 55.80451 65.63316 59.05351 56.80017 [9] 60.84571 55.47826 60.03571 59.83429 61.12984 NA 64.72250 54.86795 [17] 55.83838 52.42317 63.16917 57.32980 > > Max(tmp5,na.rm=TRUE) [1] 464.3594 > Min(tmp5,na.rm=TRUE) [1] 52.42317 > mean(tmp5,na.rm=TRUE) [1] 72.36296 > Sum(tmp5,na.rm=TRUE) [1] 14400.23 > Var(tmp5,na.rm=TRUE) [1] 855.234 > > rowMeans(tmp5,na.rm=TRUE) [1] 89.06350 69.20297 72.02897 72.51328 67.72165 70.97690 72.41568 70.80696 [9] 70.36090 68.30667 > rowSums(tmp5,na.rm=TRUE) [1] 1781.270 1384.059 1440.579 1450.266 1286.711 1419.538 1448.314 1416.139 [9] 1407.218 1366.133 > rowVars(tmp5,na.rm=TRUE) [1] 7862.39820 74.38876 71.17867 62.37767 89.25147 75.61868 [7] 85.17504 87.73499 82.96540 74.15327 > rowSd(tmp5,na.rm=TRUE) [1] 88.670165 8.624892 8.436745 7.897953 9.447300 8.695900 9.229032 [8] 9.366696 9.108535 8.611229 > rowMax(tmp5,na.rm=TRUE) [1] 464.35939 85.72407 86.15828 90.04240 85.95791 87.86185 91.23461 [8] 89.29302 85.03118 88.03103 > rowMin(tmp5,na.rm=TRUE) [1] 59.05351 56.45256 56.49335 55.85970 52.42317 56.14386 52.69782 57.10235 [9] 54.86795 57.32980 > > colMeans(tmp5,na.rm=TRUE) [1] 109.87108 69.36407 71.25745 66.28384 67.53924 75.05674 71.67881 [8] 70.51994 73.48270 64.31367 70.04718 71.25576 70.00863 67.28180 [15] 73.78779 72.30604 70.36314 64.32280 74.53101 73.47931 > colSums(tmp5,na.rm=TRUE) [1] 1098.7108 693.6407 712.5745 662.8384 675.3924 750.5674 716.7881 [8] 705.1994 734.8270 643.1367 700.4718 712.5576 700.0863 605.5362 [15] 737.8779 723.0604 703.6314 643.2280 745.3101 734.7931 > colVars(tmp5,na.rm=TRUE) [1] 15641.62281 73.40730 80.44975 30.05012 82.96504 59.26212 [7] 81.82285 85.78983 103.01376 79.72074 69.06772 58.84012 [13] 29.01763 49.83745 25.52752 90.06457 120.30358 81.88011 [19] 63.58514 62.83936 > colSd(tmp5,na.rm=TRUE) [1] 125.066474 8.567806 8.969378 5.481799 9.108515 7.698190 [7] 9.045599 9.262280 10.149570 8.928647 8.310699 7.670731 [13] 5.386801 7.059564 5.052476 9.490236 10.968299 9.048763 [19] 7.974029 7.927128 > colMax(tmp5,na.rm=TRUE) [1] 464.35939 83.77597 90.04240 73.61912 81.87255 85.66061 86.29941 [8] 87.86185 85.72407 81.60998 86.15828 80.49368 79.40051 79.50804 [15] 80.46105 85.95791 89.29302 79.23129 88.03103 81.35120 > colMin(tmp5,na.rm=TRUE) [1] 55.85970 56.65220 61.31634 58.21886 55.80451 65.63316 59.05351 56.80017 [9] 60.84571 55.47826 60.03571 59.83429 61.12984 52.69782 64.72250 54.86795 [17] 55.83838 52.42317 63.16917 57.32980 > > # now set an entire row to NA > > tmp5[which.row,] <- NA > rowMeans(tmp5,na.rm=TRUE) [1] 89.06350 69.20297 72.02897 72.51328 NaN 70.97690 72.41568 70.80696 [9] 70.36090 68.30667 > rowSums(tmp5,na.rm=TRUE) [1] 1781.270 1384.059 1440.579 1450.266 0.000 1419.538 1448.314 1416.139 [9] 1407.218 1366.133 > rowVars(tmp5,na.rm=TRUE) [1] 7862.39820 74.38876 71.17867 62.37767 NA 75.61868 [7] 85.17504 87.73499 82.96540 74.15327 > rowSd(tmp5,na.rm=TRUE) [1] 88.670165 8.624892 8.436745 7.897953 NA 8.695900 9.229032 [8] 9.366696 9.108535 8.611229 > rowMax(tmp5,na.rm=TRUE) [1] 464.35939 85.72407 86.15828 90.04240 NA 87.86185 91.23461 [8] 89.29302 85.03118 88.03103 > rowMin(tmp5,na.rm=TRUE) [1] 59.05351 56.45256 56.49335 55.85970 NA 56.14386 52.69782 57.10235 [9] 54.86795 57.32980 > > > # now set an entire col to NA > > > tmp5[,which.col] <- NA > colMeans(tmp5,na.rm=TRUE) [1] 115.06945 67.76274 71.99921 67.11878 66.05433 75.16961 71.86233 [8] 72.04436 74.88681 63.19274 70.87489 71.52061 70.16554 NaN [15] 73.67631 70.78917 71.97700 65.64498 75.79343 74.17334 > colSums(tmp5,na.rm=TRUE) [1] 1035.6251 609.8647 647.9929 604.0690 594.4890 676.5265 646.7610 [8] 648.3992 673.9813 568.7347 637.8740 643.6855 631.4898 0.0000 [15] 663.0868 637.1025 647.7930 590.8048 682.1409 667.5601 > colVars(tmp5,na.rm=TRUE) [1] 17292.81658 53.73558 84.31617 25.96371 68.53009 66.52655 [7] 91.67183 70.37023 93.71081 75.55057 69.99386 65.40602 [13] 32.36786 NA 28.57863 75.43743 106.04034 72.44828 [19] 53.60392 65.27537 > colSd(tmp5,na.rm=TRUE) [1] 131.502154 7.330456 9.182383 5.095460 8.278291 8.156381 [7] 9.574541 8.388696 9.680434 8.691983 8.366233 8.087399 [13] 5.689276 NA 5.345898 8.685472 10.297589 8.511655 [19] 7.321470 8.079317 > colMax(tmp5,na.rm=TRUE) [1] 464.35939 75.86332 90.04240 73.61912 81.87255 85.66061 86.29941 [8] 87.86185 85.72407 81.60998 86.15828 80.49368 79.40051 -Inf [15] 80.46105 83.63402 89.29302 79.23129 88.03103 81.35120 > colMin(tmp5,na.rm=TRUE) [1] 55.85970 56.65220 61.31634 58.21886 55.80451 65.63316 59.05351 62.57765 [9] 61.43307 55.47826 60.03571 59.83429 61.12984 Inf 64.72250 54.86795 [17] 57.70137 56.45256 65.04096 57.32980 > > > > > 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] 216.4276 193.0020 149.9601 281.0717 323.5689 176.9881 127.7617 144.3001 [9] 171.4332 245.9630 > apply(copymatrix,1,var,na.rm=TRUE) [1] 216.4276 193.0020 149.9601 281.0717 323.5689 176.9881 127.7617 144.3001 [9] 171.4332 245.9630 > > > > copymatrix <- matrix(rnorm(200,150,15),10,20) > > tmp5[1:10,1:20] <- copymatrix > which.row <- 1 > which.col <- 3 > cat(which.row," ",which.col,"\n") 1 3 > tmp5[which.row,which.col] <- NA > copymatrix[which.row,which.col] <- NA > > colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE) [1] 2.842171e-14 -2.842171e-14 1.136868e-13 5.684342e-14 4.263256e-14 [6] 0.000000e+00 0.000000e+00 -1.421085e-13 -1.421085e-13 5.684342e-14 [11] 5.684342e-14 1.136868e-13 -1.705303e-13 1.136868e-13 -1.136868e-13 [16] -2.842171e-14 2.842171e-14 -1.705303e-13 2.842171e-14 -2.273737e-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) + } 9 12 9 9 8 2 1 15 9 3 3 5 2 5 3 1 3 19 9 8 10 17 7 14 10 3 5 4 5 19 6 10 2 5 1 6 5 20 2 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.135669 > Min(tmp) [1] -2.048279 > mean(tmp) [1] -0.1327499 > Sum(tmp) [1] -13.27499 > Var(tmp) [1] 0.7421895 > > rowMeans(tmp) [1] -0.1327499 > rowSums(tmp) [1] -13.27499 > rowVars(tmp) [1] 0.7421895 > rowSd(tmp) [1] 0.8615042 > rowMax(tmp) [1] 2.135669 > rowMin(tmp) [1] -2.048279 > > colMeans(tmp) [1] -0.0004289476 0.7464094512 0.0933725047 -0.1612423683 0.6786609637 [6] -1.4878985449 -0.7661761863 0.9984644072 0.0404766035 -0.3080655324 [11] -0.0408990696 0.1416400874 0.1285474533 -1.0084174903 1.5145675544 [16] -1.4436785438 0.5520253536 0.1255912943 1.0447163230 0.2565064621 [21] 0.6523762562 2.0824720914 0.2115179370 0.0147382339 0.0822517877 [26] -1.0479742870 1.4729608007 -2.0482790197 -0.7385693385 0.0281733936 [31] -0.3351158883 0.1339922055 -0.7144384444 -1.2224378666 -0.3076482573 [36] -0.1639858363 -1.6312115122 0.0644902672 1.2612059324 -1.0632637967 [41] 0.6754779448 -1.3593153527 -0.9409210335 0.7612213615 -1.2670629466 [46] -0.4729628365 -0.3609845571 0.2508959171 -0.1313819893 -0.3273875188 [51] -0.0455904358 0.2111255908 -0.9670083156 -0.4365493698 0.4594762060 [56] -0.2949973142 -1.1185678256 1.1335239526 0.1401152076 -0.8532833023 [61] -0.4414245752 -0.8922313328 0.4201047064 -0.9686155992 -0.0150901797 [66] -0.9964204309 1.0782515730 -0.4345019089 1.0592946650 1.2818765146 [71] -0.0489631969 -0.3960266922 -0.1644870399 1.0299524040 -0.6857261114 [76] -1.0840791186 -0.9910032237 0.0088991394 -0.6579609513 -0.9174147420 [81] 2.1356685970 -0.3454596455 -0.3037338245 1.4109078629 -1.9540525389 [86] -1.5510494056 -0.0698715638 -1.8496794314 0.1040667344 -0.2808142677 [91] 0.3752501492 0.5420713510 0.9126368878 0.4946172861 -0.4679860259 [96] 0.3171056680 -1.1618606907 -0.3987051911 -0.1655392777 -0.0942457789 > colSums(tmp) [1] -0.0004289476 0.7464094512 0.0933725047 -0.1612423683 0.6786609637 [6] -1.4878985449 -0.7661761863 0.9984644072 0.0404766035 -0.3080655324 [11] -0.0408990696 0.1416400874 0.1285474533 -1.0084174903 1.5145675544 [16] -1.4436785438 0.5520253536 0.1255912943 1.0447163230 0.2565064621 [21] 0.6523762562 2.0824720914 0.2115179370 0.0147382339 0.0822517877 [26] -1.0479742870 1.4729608007 -2.0482790197 -0.7385693385 0.0281733936 [31] -0.3351158883 0.1339922055 -0.7144384444 -1.2224378666 -0.3076482573 [36] -0.1639858363 -1.6312115122 0.0644902672 1.2612059324 -1.0632637967 [41] 0.6754779448 -1.3593153527 -0.9409210335 0.7612213615 -1.2670629466 [46] -0.4729628365 -0.3609845571 0.2508959171 -0.1313819893 -0.3273875188 [51] -0.0455904358 0.2111255908 -0.9670083156 -0.4365493698 0.4594762060 [56] -0.2949973142 -1.1185678256 1.1335239526 0.1401152076 -0.8532833023 [61] -0.4414245752 -0.8922313328 0.4201047064 -0.9686155992 -0.0150901797 [66] -0.9964204309 1.0782515730 -0.4345019089 1.0592946650 1.2818765146 [71] -0.0489631969 -0.3960266922 -0.1644870399 1.0299524040 -0.6857261114 [76] -1.0840791186 -0.9910032237 0.0088991394 -0.6579609513 -0.9174147420 [81] 2.1356685970 -0.3454596455 -0.3037338245 1.4109078629 -1.9540525389 [86] -1.5510494056 -0.0698715638 -1.8496794314 0.1040667344 -0.2808142677 [91] 0.3752501492 0.5420713510 0.9126368878 0.4946172861 -0.4679860259 [96] 0.3171056680 -1.1618606907 -0.3987051911 -0.1655392777 -0.0942457789 > 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.0004289476 0.7464094512 0.0933725047 -0.1612423683 0.6786609637 [6] -1.4878985449 -0.7661761863 0.9984644072 0.0404766035 -0.3080655324 [11] -0.0408990696 0.1416400874 0.1285474533 -1.0084174903 1.5145675544 [16] -1.4436785438 0.5520253536 0.1255912943 1.0447163230 0.2565064621 [21] 0.6523762562 2.0824720914 0.2115179370 0.0147382339 0.0822517877 [26] -1.0479742870 1.4729608007 -2.0482790197 -0.7385693385 0.0281733936 [31] -0.3351158883 0.1339922055 -0.7144384444 -1.2224378666 -0.3076482573 [36] -0.1639858363 -1.6312115122 0.0644902672 1.2612059324 -1.0632637967 [41] 0.6754779448 -1.3593153527 -0.9409210335 0.7612213615 -1.2670629466 [46] -0.4729628365 -0.3609845571 0.2508959171 -0.1313819893 -0.3273875188 [51] -0.0455904358 0.2111255908 -0.9670083156 -0.4365493698 0.4594762060 [56] -0.2949973142 -1.1185678256 1.1335239526 0.1401152076 -0.8532833023 [61] -0.4414245752 -0.8922313328 0.4201047064 -0.9686155992 -0.0150901797 [66] -0.9964204309 1.0782515730 -0.4345019089 1.0592946650 1.2818765146 [71] -0.0489631969 -0.3960266922 -0.1644870399 1.0299524040 -0.6857261114 [76] -1.0840791186 -0.9910032237 0.0088991394 -0.6579609513 -0.9174147420 [81] 2.1356685970 -0.3454596455 -0.3037338245 1.4109078629 -1.9540525389 [86] -1.5510494056 -0.0698715638 -1.8496794314 0.1040667344 -0.2808142677 [91] 0.3752501492 0.5420713510 0.9126368878 0.4946172861 -0.4679860259 [96] 0.3171056680 -1.1618606907 -0.3987051911 -0.1655392777 -0.0942457789 > colMin(tmp) [1] -0.0004289476 0.7464094512 0.0933725047 -0.1612423683 0.6786609637 [6] -1.4878985449 -0.7661761863 0.9984644072 0.0404766035 -0.3080655324 [11] -0.0408990696 0.1416400874 0.1285474533 -1.0084174903 1.5145675544 [16] -1.4436785438 0.5520253536 0.1255912943 1.0447163230 0.2565064621 [21] 0.6523762562 2.0824720914 0.2115179370 0.0147382339 0.0822517877 [26] -1.0479742870 1.4729608007 -2.0482790197 -0.7385693385 0.0281733936 [31] -0.3351158883 0.1339922055 -0.7144384444 -1.2224378666 -0.3076482573 [36] -0.1639858363 -1.6312115122 0.0644902672 1.2612059324 -1.0632637967 [41] 0.6754779448 -1.3593153527 -0.9409210335 0.7612213615 -1.2670629466 [46] -0.4729628365 -0.3609845571 0.2508959171 -0.1313819893 -0.3273875188 [51] -0.0455904358 0.2111255908 -0.9670083156 -0.4365493698 0.4594762060 [56] -0.2949973142 -1.1185678256 1.1335239526 0.1401152076 -0.8532833023 [61] -0.4414245752 -0.8922313328 0.4201047064 -0.9686155992 -0.0150901797 [66] -0.9964204309 1.0782515730 -0.4345019089 1.0592946650 1.2818765146 [71] -0.0489631969 -0.3960266922 -0.1644870399 1.0299524040 -0.6857261114 [76] -1.0840791186 -0.9910032237 0.0088991394 -0.6579609513 -0.9174147420 [81] 2.1356685970 -0.3454596455 -0.3037338245 1.4109078629 -1.9540525389 [86] -1.5510494056 -0.0698715638 -1.8496794314 0.1040667344 -0.2808142677 [91] 0.3752501492 0.5420713510 0.9126368878 0.4946172861 -0.4679860259 [96] 0.3171056680 -1.1618606907 -0.3987051911 -0.1655392777 -0.0942457789 > colMedians(tmp) [1] -0.0004289476 0.7464094512 0.0933725047 -0.1612423683 0.6786609637 [6] -1.4878985449 -0.7661761863 0.9984644072 0.0404766035 -0.3080655324 [11] -0.0408990696 0.1416400874 0.1285474533 -1.0084174903 1.5145675544 [16] -1.4436785438 0.5520253536 0.1255912943 1.0447163230 0.2565064621 [21] 0.6523762562 2.0824720914 0.2115179370 0.0147382339 0.0822517877 [26] -1.0479742870 1.4729608007 -2.0482790197 -0.7385693385 0.0281733936 [31] -0.3351158883 0.1339922055 -0.7144384444 -1.2224378666 -0.3076482573 [36] -0.1639858363 -1.6312115122 0.0644902672 1.2612059324 -1.0632637967 [41] 0.6754779448 -1.3593153527 -0.9409210335 0.7612213615 -1.2670629466 [46] -0.4729628365 -0.3609845571 0.2508959171 -0.1313819893 -0.3273875188 [51] -0.0455904358 0.2111255908 -0.9670083156 -0.4365493698 0.4594762060 [56] -0.2949973142 -1.1185678256 1.1335239526 0.1401152076 -0.8532833023 [61] -0.4414245752 -0.8922313328 0.4201047064 -0.9686155992 -0.0150901797 [66] -0.9964204309 1.0782515730 -0.4345019089 1.0592946650 1.2818765146 [71] -0.0489631969 -0.3960266922 -0.1644870399 1.0299524040 -0.6857261114 [76] -1.0840791186 -0.9910032237 0.0088991394 -0.6579609513 -0.9174147420 [81] 2.1356685970 -0.3454596455 -0.3037338245 1.4109078629 -1.9540525389 [86] -1.5510494056 -0.0698715638 -1.8496794314 0.1040667344 -0.2808142677 [91] 0.3752501492 0.5420713510 0.9126368878 0.4946172861 -0.4679860259 [96] 0.3171056680 -1.1618606907 -0.3987051911 -0.1655392777 -0.0942457789 > colRanges(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [1,] -0.0004289476 0.7464095 0.0933725 -0.1612424 0.678661 -1.487899 -0.7661762 [2,] -0.0004289476 0.7464095 0.0933725 -0.1612424 0.678661 -1.487899 -0.7661762 [,8] [,9] [,10] [,11] [,12] [,13] [,14] [1,] 0.9984644 0.0404766 -0.3080655 -0.04089907 0.1416401 0.1285475 -1.008417 [2,] 0.9984644 0.0404766 -0.3080655 -0.04089907 0.1416401 0.1285475 -1.008417 [,15] [,16] [,17] [,18] [,19] [,20] [,21] [1,] 1.514568 -1.443679 0.5520254 0.1255913 1.044716 0.2565065 0.6523763 [2,] 1.514568 -1.443679 0.5520254 0.1255913 1.044716 0.2565065 0.6523763 [,22] [,23] [,24] [,25] [,26] [,27] [,28] [1,] 2.082472 0.2115179 0.01473823 0.08225179 -1.047974 1.472961 -2.048279 [2,] 2.082472 0.2115179 0.01473823 0.08225179 -1.047974 1.472961 -2.048279 [,29] [,30] [,31] [,32] [,33] [,34] [,35] [1,] -0.7385693 0.02817339 -0.3351159 0.1339922 -0.7144384 -1.222438 -0.3076483 [2,] -0.7385693 0.02817339 -0.3351159 0.1339922 -0.7144384 -1.222438 -0.3076483 [,36] [,37] [,38] [,39] [,40] [,41] [,42] [1,] -0.1639858 -1.631212 0.06449027 1.261206 -1.063264 0.6754779 -1.359315 [2,] -0.1639858 -1.631212 0.06449027 1.261206 -1.063264 0.6754779 -1.359315 [,43] [,44] [,45] [,46] [,47] [,48] [,49] [1,] -0.940921 0.7612214 -1.267063 -0.4729628 -0.3609846 0.2508959 -0.131382 [2,] -0.940921 0.7612214 -1.267063 -0.4729628 -0.3609846 0.2508959 -0.131382 [,50] [,51] [,52] [,53] [,54] [,55] [1,] -0.3273875 -0.04559044 0.2111256 -0.9670083 -0.4365494 0.4594762 [2,] -0.3273875 -0.04559044 0.2111256 -0.9670083 -0.4365494 0.4594762 [,56] [,57] [,58] [,59] [,60] [,61] [,62] [1,] -0.2949973 -1.118568 1.133524 0.1401152 -0.8532833 -0.4414246 -0.8922313 [2,] -0.2949973 -1.118568 1.133524 0.1401152 -0.8532833 -0.4414246 -0.8922313 [,63] [,64] [,65] [,66] [,67] [,68] [,69] [1,] 0.4201047 -0.9686156 -0.01509018 -0.9964204 1.078252 -0.4345019 1.059295 [2,] 0.4201047 -0.9686156 -0.01509018 -0.9964204 1.078252 -0.4345019 1.059295 [,70] [,71] [,72] [,73] [,74] [,75] [,76] [1,] 1.281877 -0.0489632 -0.3960267 -0.164487 1.029952 -0.6857261 -1.084079 [2,] 1.281877 -0.0489632 -0.3960267 -0.164487 1.029952 -0.6857261 -1.084079 [,77] [,78] [,79] [,80] [,81] [,82] [,83] [1,] -0.9910032 0.008899139 -0.657961 -0.9174147 2.135669 -0.3454596 -0.3037338 [2,] -0.9910032 0.008899139 -0.657961 -0.9174147 2.135669 -0.3454596 -0.3037338 [,84] [,85] [,86] [,87] [,88] [,89] [,90] [1,] 1.410908 -1.954053 -1.551049 -0.06987156 -1.849679 0.1040667 -0.2808143 [2,] 1.410908 -1.954053 -1.551049 -0.06987156 -1.849679 0.1040667 -0.2808143 [,91] [,92] [,93] [,94] [,95] [,96] [,97] [1,] 0.3752501 0.5420714 0.9126369 0.4946173 -0.467986 0.3171057 -1.161861 [2,] 0.3752501 0.5420714 0.9126369 0.4946173 -0.467986 0.3171057 -1.161861 [,98] [,99] [,100] [1,] -0.3987052 -0.1655393 -0.09424578 [2,] -0.3987052 -0.1655393 -0.09424578 > > > Max(tmp2) [1] 2.668681 > Min(tmp2) [1] -2.209345 > mean(tmp2) [1] -0.07430676 > Sum(tmp2) [1] -7.430676 > Var(tmp2) [1] 0.9982058 > > rowMeans(tmp2) [1] -0.895976706 0.631671095 0.148686684 -1.148742788 -1.040407522 [6] -0.472696621 0.721723930 0.069968134 0.535088250 -0.989208768 [11] -0.068256489 0.836545001 0.161201394 0.377155335 -1.228280226 [16] -0.774735335 -0.426088791 -1.024947464 -0.966309833 0.316202207 [21] -1.359331094 1.018960953 0.522222560 0.521078029 -0.718781025 [26] -0.006592089 0.386872820 -1.111163098 -0.778824040 1.128665338 [31] -0.034797272 0.673088865 -0.763097203 0.211665587 -0.920309504 [36] 2.668681495 2.111904849 0.989786966 -1.746593711 1.457989056 [41] -0.734141986 -0.770924343 -0.412162230 -0.405641706 1.343177060 [46] -0.662082877 -2.084514976 1.769037550 -0.773399472 1.925925657 [51] -2.083640903 -0.581844385 1.013868963 0.369898630 -0.619608320 [56] -2.209344629 -0.191573298 -1.318735436 0.973617146 0.740145441 [61] -0.284503040 -0.776222529 1.521238126 -0.562379565 -0.345844431 [66] 0.717585572 -1.219744485 -0.673841640 0.672719722 -0.900216285 [71] 0.366218872 -0.977216644 0.060169276 -0.982498364 -0.018278860 [76] 0.071169329 0.163565341 1.640540287 0.198727944 -0.640749081 [81] -0.898647996 -0.228991016 -1.127105121 0.323755146 0.145809016 [86] 0.166200572 0.798750542 -1.687701207 -0.058424113 0.777906304 [91] -0.811837314 0.222319883 -0.494907739 0.387012597 0.102095084 [96] -0.339088020 2.323938700 -1.651737079 1.850029791 0.437431925 > rowSums(tmp2) [1] -0.895976706 0.631671095 0.148686684 -1.148742788 -1.040407522 [6] -0.472696621 0.721723930 0.069968134 0.535088250 -0.989208768 [11] -0.068256489 0.836545001 0.161201394 0.377155335 -1.228280226 [16] -0.774735335 -0.426088791 -1.024947464 -0.966309833 0.316202207 [21] -1.359331094 1.018960953 0.522222560 0.521078029 -0.718781025 [26] -0.006592089 0.386872820 -1.111163098 -0.778824040 1.128665338 [31] -0.034797272 0.673088865 -0.763097203 0.211665587 -0.920309504 [36] 2.668681495 2.111904849 0.989786966 -1.746593711 1.457989056 [41] -0.734141986 -0.770924343 -0.412162230 -0.405641706 1.343177060 [46] -0.662082877 -2.084514976 1.769037550 -0.773399472 1.925925657 [51] -2.083640903 -0.581844385 1.013868963 0.369898630 -0.619608320 [56] -2.209344629 -0.191573298 -1.318735436 0.973617146 0.740145441 [61] -0.284503040 -0.776222529 1.521238126 -0.562379565 -0.345844431 [66] 0.717585572 -1.219744485 -0.673841640 0.672719722 -0.900216285 [71] 0.366218872 -0.977216644 0.060169276 -0.982498364 -0.018278860 [76] 0.071169329 0.163565341 1.640540287 0.198727944 -0.640749081 [81] -0.898647996 -0.228991016 -1.127105121 0.323755146 0.145809016 [86] 0.166200572 0.798750542 -1.687701207 -0.058424113 0.777906304 [91] -0.811837314 0.222319883 -0.494907739 0.387012597 0.102095084 [96] -0.339088020 2.323938700 -1.651737079 1.850029791 0.437431925 > 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.895976706 0.631671095 0.148686684 -1.148742788 -1.040407522 [6] -0.472696621 0.721723930 0.069968134 0.535088250 -0.989208768 [11] -0.068256489 0.836545001 0.161201394 0.377155335 -1.228280226 [16] -0.774735335 -0.426088791 -1.024947464 -0.966309833 0.316202207 [21] -1.359331094 1.018960953 0.522222560 0.521078029 -0.718781025 [26] -0.006592089 0.386872820 -1.111163098 -0.778824040 1.128665338 [31] -0.034797272 0.673088865 -0.763097203 0.211665587 -0.920309504 [36] 2.668681495 2.111904849 0.989786966 -1.746593711 1.457989056 [41] -0.734141986 -0.770924343 -0.412162230 -0.405641706 1.343177060 [46] -0.662082877 -2.084514976 1.769037550 -0.773399472 1.925925657 [51] -2.083640903 -0.581844385 1.013868963 0.369898630 -0.619608320 [56] -2.209344629 -0.191573298 -1.318735436 0.973617146 0.740145441 [61] -0.284503040 -0.776222529 1.521238126 -0.562379565 -0.345844431 [66] 0.717585572 -1.219744485 -0.673841640 0.672719722 -0.900216285 [71] 0.366218872 -0.977216644 0.060169276 -0.982498364 -0.018278860 [76] 0.071169329 0.163565341 1.640540287 0.198727944 -0.640749081 [81] -0.898647996 -0.228991016 -1.127105121 0.323755146 0.145809016 [86] 0.166200572 0.798750542 -1.687701207 -0.058424113 0.777906304 [91] -0.811837314 0.222319883 -0.494907739 0.387012597 0.102095084 [96] -0.339088020 2.323938700 -1.651737079 1.850029791 0.437431925 > rowMin(tmp2) [1] -0.895976706 0.631671095 0.148686684 -1.148742788 -1.040407522 [6] -0.472696621 0.721723930 0.069968134 0.535088250 -0.989208768 [11] -0.068256489 0.836545001 0.161201394 0.377155335 -1.228280226 [16] -0.774735335 -0.426088791 -1.024947464 -0.966309833 0.316202207 [21] -1.359331094 1.018960953 0.522222560 0.521078029 -0.718781025 [26] -0.006592089 0.386872820 -1.111163098 -0.778824040 1.128665338 [31] -0.034797272 0.673088865 -0.763097203 0.211665587 -0.920309504 [36] 2.668681495 2.111904849 0.989786966 -1.746593711 1.457989056 [41] -0.734141986 -0.770924343 -0.412162230 -0.405641706 1.343177060 [46] -0.662082877 -2.084514976 1.769037550 -0.773399472 1.925925657 [51] -2.083640903 -0.581844385 1.013868963 0.369898630 -0.619608320 [56] -2.209344629 -0.191573298 -1.318735436 0.973617146 0.740145441 [61] -0.284503040 -0.776222529 1.521238126 -0.562379565 -0.345844431 [66] 0.717585572 -1.219744485 -0.673841640 0.672719722 -0.900216285 [71] 0.366218872 -0.977216644 0.060169276 -0.982498364 -0.018278860 [76] 0.071169329 0.163565341 1.640540287 0.198727944 -0.640749081 [81] -0.898647996 -0.228991016 -1.127105121 0.323755146 0.145809016 [86] 0.166200572 0.798750542 -1.687701207 -0.058424113 0.777906304 [91] -0.811837314 0.222319883 -0.494907739 0.387012597 0.102095084 [96] -0.339088020 2.323938700 -1.651737079 1.850029791 0.437431925 > > colMeans(tmp2) [1] -0.07430676 > colSums(tmp2) [1] -7.430676 > colVars(tmp2) [1] 0.9982058 > colSd(tmp2) [1] 0.9991025 > colMax(tmp2) [1] 2.668681 > colMin(tmp2) [1] -2.209345 > colMedians(tmp2) [1] -0.04661069 > colRanges(tmp2) [,1] [1,] -2.209345 [2,] 2.668681 > > 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] -8.10737029 0.07701102 -2.69329026 8.09256415 2.76667008 -2.03419811 [7] 1.78882081 0.17345490 -2.57684358 -0.38396881 > colApply(tmp,quantile)[,1] [,1] [1,] -2.1043799 [2,] -1.3365685 [3,] -1.0095372 [4,] -0.3933458 [5,] 0.8211023 > > rowApply(tmp,sum) [1] -4.3830217 4.0926701 0.3885387 2.8010826 -1.7826359 -2.6043446 [7] 3.4891191 -4.4069520 0.4776051 -0.9692114 > rowApply(tmp,rank)[1:10,] [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 4 1 2 3 4 1 1 8 5 5 [2,] 5 10 3 9 2 10 7 4 8 1 [3,] 8 7 5 1 9 3 8 2 2 7 [4,] 10 6 10 4 5 8 3 10 9 6 [5,] 1 3 8 8 6 4 4 9 4 8 [6,] 7 2 9 10 1 5 2 5 3 3 [7,] 2 9 7 2 8 9 10 1 10 4 [8,] 9 8 6 7 3 7 6 7 6 2 [9,] 6 5 4 6 7 2 9 3 1 10 [10,] 3 4 1 5 10 6 5 6 7 9 > > tmp <- createBufferedMatrix(5,20) > > tmp[1:5,1:20] <- rnorm(100) > colApply(tmp,sum) [1] 1.282075 -1.242689 1.863724 3.583852 -1.789534 -1.058198 0.816807 [8] -1.807781 -1.432439 1.029766 -3.519831 2.323916 -1.311869 1.438465 [15] 2.043080 -1.095507 3.921410 -5.130894 -1.097725 -3.517726 > colApply(tmp,quantile)[,1] [,1] [1,] -0.8377801 [2,] -0.6053270 [3,] -0.4385885 [4,] 0.7203055 [5,] 2.4434653 > > rowApply(tmp,sum) [1] 2.09632010 1.78361727 -5.29164698 -0.09570361 -3.19368533 > rowApply(tmp,rank)[1:5,] [,1] [,2] [,3] [,4] [,5] [1,] 20 6 18 6 9 [2,] 8 10 15 16 1 [3,] 3 14 12 20 13 [4,] 15 18 13 15 15 [5,] 1 12 6 8 14 > > > as.matrix(tmp) [,1] [,2] [,3] [,4] [,5] [,6] [1,] 2.4434653 -0.4937806 -1.0722401 0.6213151 -1.2570817 -0.02812249 [2,] -0.8377801 0.1574314 0.8589331 1.4128061 0.5486082 -1.47100481 [3,] 0.7203055 0.4663283 0.2764441 0.3652573 -0.7828894 -0.12466337 [4,] -0.6053270 0.9450171 1.6248168 0.8964221 -0.5070290 -0.56973211 [5,] -0.4385885 -2.3176851 0.1757706 0.2880513 0.2088580 1.13532508 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 1.4811676 -0.31805900 -0.5826815 1.0200873 -0.8367545 2.130291761 [2,] 1.3548639 -1.19804094 0.9071163 0.8597632 -0.8255059 -1.181009587 [3,] -1.8698207 -0.09872469 0.6559036 -2.2067891 -1.2280954 -0.182588349 [4,] 0.5900358 -0.18256592 -0.8891091 1.0142062 -0.1360604 1.548082136 [5,] -0.7394396 -0.01039086 -1.5236687 0.3424988 -0.4934151 0.009139823 [,13] [,14] [,15] [,16] [,17] [,18] [1,] -0.3017173 -0.8315693 1.2591037 0.4112476 0.1871644 -0.9860955 [2,] -0.5354841 0.5805872 0.4323735 -1.4510542 1.7103623 -0.1614523 [3,] -0.7053481 1.1106377 0.6995344 1.5053950 0.4611535 -1.4603091 [4,] 1.0641055 -0.2148604 -1.1641183 -0.9936842 -0.1817531 -1.8109140 [5,] -0.8334249 0.7936698 0.8161863 -0.5674111 1.7444832 -0.7121234 [,19] [,20] [1,] 0.46756744 -1.2169881 [2,] 1.61227822 -0.9901741 [3,] -3.12103807 0.2276598 [4,] 0.09008763 -0.6133234 [5,] -0.14662019 -0.9249007 > > > is.BufferedMatrix(tmp) [1] TRUE > > as.BufferedMatrix(as.matrix(tmp)) BufferedMatrix object Matrix size: 5 20 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 800 bytes. > > > > subBufferedMatrix(tmp,1:5,1:5) BufferedMatrix object Matrix size: 5 5 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 653 bytes. Disk usage : 200 bytes. > subBufferedMatrix(tmp,,5:8) BufferedMatrix object Matrix size: 5 4 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 566 bytes. Disk usage : 160 bytes. > subBufferedMatrix(tmp,1:3,) BufferedMatrix object Matrix size: 3 20 Buffer size: 1 1 Directory: /home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests Prefix: BM Mode: Col mode Read Only: FALSE Memory usage : 1.9 Kilobytes. Disk usage : 480 bytes. > > > rm(tmp) > > > ### > ### Testing colnames and rownames > ### > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > > > colnames(tmp) NULL > rownames(tmp) NULL > > > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > rownames(tmp) <- rownames(tmp,do.NULL=FALSE) > > colnames(tmp) [1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9" [10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18" [19] "col19" "col20" > rownames(tmp) [1] "row1" "row2" "row3" "row4" "row5" > > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 row1 1.072271 -0.105415 1.246423 0.3858477 -0.2511012 -1.51183 -1.903313 col8 col9 col10 col11 col12 col13 col14 row1 0.5180374 1.633811 -0.08681529 -1.196268 1.483666 0.3676545 -0.1322318 col15 col16 col17 col18 col19 col20 row1 1.036194 -1.787196 1.238582 0.5000677 -0.1326037 1.183039 > tmp[,"col10"] col10 row1 -0.08681529 row2 0.95557966 row3 0.83169163 row4 0.24515804 row5 1.27645920 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 row1 1.0722710 -0.1054150 1.2464226 0.3858477 -0.2511012 -1.5118296 row5 -0.9998216 -0.1959044 -0.1045173 0.9323576 2.2247577 -0.2573657 col7 col8 col9 col10 col11 col12 col13 row1 -1.9033133 0.5180374 1.6338106 -0.08681529 -1.1962684 1.4836661 0.3676545 row5 -0.7046143 1.1145043 0.7452813 1.27645920 0.8902384 -0.3692328 1.4994765 col14 col15 col16 col17 col18 col19 col20 row1 -0.1322318 1.036194 -1.787196 1.238582 0.5000677 -0.1326037 1.1830387 row5 0.7364460 0.162418 0.855980 -0.679186 -0.3558738 0.9304754 -0.4611562 > tmp[,c("col6","col20")] col6 col20 row1 -1.5118296 1.18303873 row2 0.4902889 0.08279873 row3 -0.5088856 0.90321188 row4 1.1678623 0.63571064 row5 -0.2573657 -0.46115617 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 -1.5118296 1.1830387 row5 -0.2573657 -0.4611562 > > > > > tmp["row1",] <- rnorm(20,mean=10) > tmp[,"col10"] <- rnorm(5,mean=30) > tmp[c("row1","row5"),] <- rnorm(40,mean=50) > tmp[,c("col6","col20")] <- rnorm(10,mean=75) > tmp[c("row1","row5"),c("col6","col20")] <- rnorm(4,mean=105) > > tmp["row1",] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.82295 47.85644 52.00861 49.23301 50.05328 105.0395 49.9623 49.37079 col9 col10 col11 col12 col13 col14 col15 col16 row1 48.60035 50.61392 49.85449 51.57673 49.90112 49.58816 51.04218 50.36848 col17 col18 col19 col20 row1 50.72852 49.23282 50.71888 105.6532 > tmp[,"col10"] col10 row1 50.61392 row2 29.89725 row3 29.42537 row4 30.14573 row5 50.55459 > tmp[c("row1","row5"),] col1 col2 col3 col4 col5 col6 col7 col8 row1 50.82295 47.85644 52.00861 49.23301 50.05328 105.0395 49.96230 49.37079 row5 48.64341 50.41102 48.48985 47.71063 50.41696 104.3175 50.09845 51.50363 col9 col10 col11 col12 col13 col14 col15 col16 row1 48.60035 50.61392 49.85449 51.57673 49.90112 49.58816 51.04218 50.36848 row5 50.50429 50.55459 48.05389 50.42543 51.25872 52.25516 50.44219 48.97981 col17 col18 col19 col20 row1 50.72852 49.23282 50.71888 105.6532 row5 52.42787 49.76632 49.17745 105.9211 > tmp[,c("col6","col20")] col6 col20 row1 105.03948 105.65321 row2 76.03265 74.89473 row3 77.11290 74.97974 row4 74.84428 73.75872 row5 104.31748 105.92114 > tmp[c("row1","row5"),c("col6","col20")] col6 col20 row1 105.0395 105.6532 row5 104.3175 105.9211 > > > subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2] col6 col20 row1 105.0395 105.6532 row5 104.3175 105.9211 > > > > > > tmp <- createBufferedMatrix(5,20) > tmp[1:5,1:20] <- rnorm(100) > colnames(tmp) <- colnames(tmp,do.NULL=FALSE) > > tmp[,"col13"] col13 [1,] -2.070465471 [2,] -0.173841244 [3,] -0.565889072 [4,] 0.878452785 [5,] 0.002856792 > tmp[,c("col17","col7")] col17 col7 [1,] 1.01147700 -0.3287663 [2,] -0.77413408 0.2165522 [3,] 0.07414977 0.9501054 [4,] 0.34174882 -0.2287671 [5,] -0.81124449 -0.4529837 > > subBufferedMatrix(tmp,,c("col6","col20"))[,1:2] col6 col20 [1,] -1.8004727 -0.6185686 [2,] -1.3585083 0.4000045 [3,] -0.2172795 0.8874348 [4,] 0.7666254 -1.1015002 [5,] 1.1174500 -0.9660798 > subBufferedMatrix(tmp,1,c("col6"))[,1] col1 [1,] -1.800473 > subBufferedMatrix(tmp,1:2,c("col6"))[,1] col6 [1,] -1.800473 [2,] -1.358508 > > > > 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.5290688 -0.1075075 -1.450196 -0.1147926 -0.6283376 -1.078341 -0.9879742 row1 0.2454342 -1.2656683 0.439793 2.4589891 0.3585043 -1.082603 0.2226799 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row3 1.128511 -1.2796427 0.1141409 0.8900175 -0.3764523 -1.1722733 -1.1982415 row1 -1.154213 0.3822543 0.6139303 0.9142945 -0.8379036 0.2145429 -0.8134425 [,15] [,16] [,17] [,18] [,19] [,20] row3 -1.067943 1.4487860 1.0396510 -0.6412555 -0.08922372 -0.6372335 row1 -1.328874 -0.2522487 0.8436028 -0.2351242 -0.21711575 -1.7033325 > subBufferedMatrix(tmp,c("row2"),1:10)[,1:10] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row2 0.9082019 0.9397012 -0.3482129 -0.2551052 1.214071 0.1140067 1.342562 [,8] [,9] [,10] row2 -0.05706505 -0.7676127 0.2513084 > subBufferedMatrix(tmp,c("row5"),1:20)[,1:20] [,1] [,2] [,3] [,4] [,5] [,6] [,7] row5 -0.2695358 -0.1168094 1.012982 0.5871479 -1.900237 1.506304 0.3089775 [,8] [,9] [,10] [,11] [,12] [,13] [,14] row5 -1.546566 1.166467 0.7478632 -0.4162 0.5112119 0.6246701 -0.6103889 [,15] [,16] [,17] [,18] [,19] [,20] row5 -0.1119384 -1.714782 -1.87761 -2.218926 -0.04982813 -0.04972314 > > > 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: 0x3e782710> > is.ReadOnlyMode(tmp) [1] TRUE > > filenames(tmp) [1] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba233d6375" [2] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba38f3f506" [3] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba542e3494" [4] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba66fcc012" [5] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba3db4f965" [6] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba6ec4ddcf" [7] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba72370215" [8] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba1f2c23a7" [9] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba73c2129e" [10] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba5ec9e333" [11] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba602cfb8f" [12] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba2c75f9b7" [13] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba3f44a57" [14] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfbafcd65e8" [15] "/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests/BM1acfba23a089d8" > > > ### 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: 0x3d4ada60> > MoveStorageDirectory(tmp,getwd(),full.path=TRUE) <pointer: 0x3d4ada60> Warning message: In dir.create(new.directory) : '/home/biocbuild/bbs-3.21-bioc/meat/BufferedMatrix.Rcheck/tests' already exists > > > RowMode(tmp) <pointer: 0x3d4ada60> > rowMedians(tmp) [1] -0.335460166 -0.412566483 -0.116394814 0.239505341 -0.122218451 [6] 0.020165171 0.667059755 -0.194571545 0.341068678 -0.119468711 [11] -0.180201196 0.026760952 -0.197644451 0.268478562 0.276855932 [16] -0.234360247 -0.120340372 -0.194553974 0.562809154 0.248684257 [21] 0.404311640 -0.079910983 0.503938067 0.217638701 -0.097252560 [26] 0.210227325 -0.656826948 -0.114720134 0.043765670 -0.050281665 [31] -0.139116586 0.043398166 -0.033104705 0.136613559 0.069896628 [36] 0.843463194 -0.247151261 0.549188745 -0.258748017 -0.797803744 [41] 0.210143149 0.052866064 -0.443964193 -0.456581562 0.229161898 [46] -0.198253321 -0.173525820 0.267778556 0.377402594 -0.339916431 [51] -0.114580879 0.093378135 0.511016648 -0.393206679 0.052872672 [56] 0.405333185 -0.597082627 0.200386532 0.152689880 -0.271831289 [61] -0.152325793 -0.329623012 0.038832873 -0.538952714 -0.292304673 [66] -0.307892577 0.059617878 -0.354963196 -0.538759673 0.499098897 [71] -0.082045615 0.356548031 -0.079784931 -0.267903875 0.355919425 [76] -0.486225200 -0.146074590 -0.259107248 -0.400383726 0.533103398 [81] 0.005434760 -0.099969056 -0.165114190 -0.008287003 -0.253645273 [86] -0.603278708 0.473287306 -0.067693394 -0.201082904 -0.423659446 [91] -0.178519012 -0.344859794 -0.097038394 0.168630422 -0.047186037 [96] -0.027331146 0.252527364 -0.006271842 -0.445779984 0.322320409 [101] -0.253259074 -0.190896072 -0.452135299 -0.248944684 0.305502287 [106] 0.135616329 -0.101111688 0.192607245 -0.069006773 -0.401410279 [111] 0.178525513 0.351062977 0.910194826 -0.079547811 -0.051946305 [116] 0.210904723 -0.024064183 0.107164519 -0.131153006 0.316185223 [121] 0.125590719 -0.115877218 -0.373316028 0.051044629 -0.210594410 [126] -0.090875607 0.383343602 0.642298313 0.443930580 -0.185170818 [131] -0.515698924 -0.181688664 -0.144411530 0.243040927 -0.138881389 [136] -0.209557786 -0.507736623 0.328704574 0.293636347 -0.088161120 [141] -0.661470200 0.047670412 0.073737133 0.199595327 0.449194399 [146] -0.016776202 -0.195947621 0.170047412 -0.151835651 0.391032261 [151] 0.210459821 -0.259105616 0.239840027 -0.169661257 -0.168733888 [156] 0.016282662 -0.213691675 0.319865720 -0.392933558 0.097327483 [161] -0.246260423 -0.131719781 0.374999526 0.239013100 -0.577509900 [166] 0.262904530 -0.224862973 -0.161540186 0.295707371 0.399447638 [171] 0.698257399 -0.363963232 -0.448522997 0.058174259 -0.281591372 [176] -0.095190842 -0.052086916 -0.256236007 0.291498760 -0.391719434 [181] -0.019977671 -0.206307460 0.703010033 0.395386404 0.161570450 [186] -0.045954403 0.340479145 0.086042035 0.301009687 -0.264291340 [191] -0.407800250 -0.158907623 0.374336491 0.123432860 0.200468126 [196] -0.186699618 0.204365931 -0.568913067 0.153166414 -0.601643053 [201] 0.286159165 -0.167586030 0.528374683 0.173935409 0.210591159 [206] 0.690520881 -0.324688047 0.080372757 -0.221420493 0.088548464 [211] 0.110795885 0.183032507 -0.582321349 -0.261793877 -0.059834468 [216] 0.167490989 -0.099178571 -0.116559564 -0.177874185 0.183886045 [221] -0.134591057 0.015107553 -0.268719959 0.160061619 0.506599485 [226] 0.015037731 0.351906495 0.062213644 0.331435178 -0.152084048 > > proc.time() user system elapsed 1.790 0.884 2.701
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-unknown-linux-gnu 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: 0xbf3e460> > .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: 0xbf3e460> > .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: 0xbf3e460> > .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: 0xbf3e460> > 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: 0xb517450> > .Call("R_bm_AddColumn",P) <pointer: 0xb517450> > .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: 0xb517450> > .Call("R_bm_AddColumn",P) <pointer: 0xb517450> > .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: 0xb517450> > 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: 0xd945ea0> > .Call("R_bm_AddColumn",P) <pointer: 0xd945ea0> > .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: 0xd945ea0> > > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0xd945ea0> > .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: 0xd945ea0> > > .Call("R_bm_RowMode",P) <pointer: 0xd945ea0> > .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: 0xd945ea0> > > .Call("R_bm_ColMode",P) <pointer: 0xd945ea0> > .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: 0xd945ea0> > 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: 0xb38ce50> > .Call("R_bm_SetPrefix",P,"BufferedMatrixFile") <pointer: 0xb38ce50> > .Call("R_bm_AddColumn",P) <pointer: 0xb38ce50> > .Call("R_bm_AddColumn",P) <pointer: 0xb38ce50> > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile1acfe06b083a8b" "BufferedMatrixFile1acfe07878f80f" > rm(P) > dir(pattern="BufferedMatrixFile") [1] "BufferedMatrixFile1acfe06b083a8b" "BufferedMatrixFile1acfe07878f80f" > > > P <- .Call("R_bm_Create",prefix,directory,1,1) > .Call("R_bm_setRows",P,10) [1] TRUE > .Call("R_bm_AddColumn",P) <pointer: 0xd8d4670> > .Call("R_bm_AddColumn",P) <pointer: 0xd8d4670> > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0xd8d4670> > .Call("R_bm_isReadOnlyMode",P) [1] TRUE > .Call("R_bm_ReadOnlyModeToggle",P) <pointer: 0xd8d4670> > .Call("R_bm_isReadOnlyMode",P) [1] FALSE > .Call("R_bm_isRowMode",P) [1] FALSE > .Call("R_bm_RowMode",P) <pointer: 0xd8d4670> > .Call("R_bm_isRowMode",P) [1] TRUE > .Call("R_bm_ColMode",P) <pointer: 0xd8d4670> > .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: 0xd922820> > .Call("R_bm_AddColumn",P) <pointer: 0xd922820> > > .Call("R_bm_getSize",P) [1] 10 2 > .Call("R_bm_getBufferSize",P) [1] 1 1 > .Call("R_bm_ResizeBuffer",P,5,5) <pointer: 0xd922820> > > .Call("R_bm_getBufferSize",P) [1] 5 5 > .Call("R_bm_ResizeBuffer",P,-1,5) <pointer: 0xd922820> > 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: 0xb90a6e0> > .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: 0xb90a6e0> > rm(P) > > proc.time() user system elapsed 0.327 0.038 0.351
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2024-11-24 r87369) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: aarch64-unknown-linux-gnu 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.316 0.044 0.346