| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-15 11:58 -0500 (Sat, 15 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.1 Patched (2025-08-23 r88802) -- "Great Square Root" | 4903 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4668 |
| 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 257/2361 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.74.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) / x86_64 | OK | OK | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / 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.74.0 |
| 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.74.0.tar.gz |
| StartedAt: 2025-11-14 07:28:24 -0000 (Fri, 14 Nov 2025) |
| EndedAt: 2025-11-14 07:28:47 -0000 (Fri, 14 Nov 2025) |
| EllapsedTime: 23.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.74.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.5.0 (2025-04-11)
* 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.74.0’
* checking package namespace information ... OK
* checking package dependencies ... OK
* checking if this is a source package ... OK
* checking if there is a namespace ... OK
* checking for hidden files and directories ... OK
* checking for portable file names ... OK
* checking for sufficient/correct file permissions ... OK
* checking whether package ‘BufferedMatrix’ can be installed ... 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.22-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/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.74.0’
** 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 -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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 -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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 -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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 -std=gnu23 -I"/home/biocbuild/R/R-4.5.0/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 -std=gnu23 -shared -L/home/biocbuild/R/R-4.5.0/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/R/R-4.5.0/lib -lR
installing to /home/biocbuild/R/R-4.5.0/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 version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 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.365 0.024 0.373
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 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.22-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 478398 25.6 1047041 56 639620 34.2
Vcells 885166 6.8 8388608 64 2080985 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 14 07:28:41 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] "Fri Nov 14 07:28:42 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: 0x355a3ff0>
>
>
>
> 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 14 07:28:42 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] "Fri Nov 14 07:28:42 2025"
>
> ColMode(tmp2)
<pointer: 0x355a3ff0>
>
>
>
> ### 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.0901191 -1.9371945 -1.5318134 0.4637538
[2,] -0.2565554 0.2945484 -0.9165517 1.1506274
[3,] -1.3771762 -0.1216376 -1.0951285 -1.7562380
[4,] 0.7085616 -1.2900901 0.2136071 1.5648808
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.0901191 1.9371945 1.5318134 0.4637538
[2,] 0.2565554 0.2945484 0.9165517 1.1506274
[3,] 1.3771762 0.1216376 1.0951285 1.7562380
[4,] 0.7085616 1.2900901 0.2136071 1.5648808
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.22-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.004505 1.3918314 1.2376645 0.6809947
[2,] 0.506513 0.5427231 0.9573671 1.0726730
[3,] 1.173532 0.3487659 1.0464839 1.3252313
[4,] 0.841761 1.1358213 0.4621765 1.2509520
>
> 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.22-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.13517 40.85551 38.90846 32.27370
[2,] 30.32169 30.72178 35.49022 36.87736
[3,] 38.11249 28.60930 36.55997 40.00855
[4,] 34.12617 37.64830 29.83537 39.07440
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x342866c0>
> exp(tmp5)
<pointer: 0x342866c0>
> log(tmp5,2)
<pointer: 0x342866c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5894
> Min(tmp5)
[1] 54.58089
> mean(tmp5)
[1] 73.15734
> Sum(tmp5)
[1] 14631.47
> Var(tmp5)
[1] 857.5085
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.78641 69.70944 72.74411 73.37675 67.07695 74.49737 72.81506 70.93039
[9] 69.54518 71.09169
> rowSums(tmp5)
[1] 1795.728 1394.189 1454.882 1467.535 1341.539 1489.947 1456.301 1418.608
[9] 1390.904 1421.834
> rowVars(tmp5)
[1] 7998.12096 53.03034 75.35001 62.71800 66.71593 66.74500
[7] 51.06436 116.23562 61.21835 61.87342
> rowSd(tmp5)
[1] 89.432214 7.282193 8.680439 7.919470 8.167982 8.169762 7.145933
[8] 10.781263 7.824216 7.865966
> rowMax(tmp5)
[1] 468.58936 80.50158 86.28699 93.43086 90.63644 89.86233 84.53821
[8] 91.78567 86.08657 90.10602
> rowMin(tmp5)
[1] 59.00943 56.58272 58.08399 61.46936 55.96551 58.31333 60.12704 54.58089
[9] 58.24917 56.07734
>
> colMeans(tmp5)
[1] 110.79459 72.53530 71.35570 70.26251 70.28239 69.30726 71.11504
[8] 69.52729 70.67390 69.14807 69.39816 71.82631 69.98381 69.05819
[15] 71.55497 70.54928 71.71181 75.62994 72.60187 75.83033
> colSums(tmp5)
[1] 1107.9459 725.3530 713.5570 702.6251 702.8239 693.0726 711.1504
[8] 695.2729 706.7390 691.4807 693.9816 718.2631 699.8381 690.5819
[15] 715.5497 705.4928 717.1181 756.2994 726.0187 758.3033
> colVars(tmp5)
[1] 15846.09727 52.81670 59.79819 68.53761 114.45197 36.39808
[7] 130.83164 76.93452 60.02634 35.90208 115.12771 78.45613
[13] 55.23166 61.88710 48.99684 76.12815 139.61123 36.48540
[19] 80.08121 54.37886
> colSd(tmp5)
[1] 125.881282 7.267510 7.732929 8.278744 10.698223 6.033082
[7] 11.438166 8.771232 7.747667 5.991835 10.729758 8.857547
[13] 7.431800 7.866836 6.999774 8.725145 11.815720 6.040314
[19] 8.948811 7.374202
> colMax(tmp5)
[1] 468.58936 85.03539 80.98286 83.27256 90.10602 79.54683 90.63644
[8] 89.86233 81.49002 78.93526 91.78567 84.33042 80.78160 89.18801
[15] 78.90013 81.35877 93.43086 87.05780 86.28699 83.95361
> colMin(tmp5)
[1] 63.11062 59.54650 57.90555 58.24917 56.58272 61.68735 56.07734 58.86618
[9] 55.96551 58.58615 58.08399 58.31333 61.46936 61.81426 59.00943 54.58089
[17] 58.77287 65.20180 57.59272 60.36640
>
>
> ### 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.78641 69.70944 72.74411 73.37675 67.07695 NA 72.81506 70.93039
[9] 69.54518 71.09169
> rowSums(tmp5)
[1] 1795.728 1394.189 1454.882 1467.535 1341.539 NA 1456.301 1418.608
[9] 1390.904 1421.834
> rowVars(tmp5)
[1] 7998.12096 53.03034 75.35001 62.71800 66.71593 70.00923
[7] 51.06436 116.23562 61.21835 61.87342
> rowSd(tmp5)
[1] 89.432214 7.282193 8.680439 7.919470 8.167982 8.367152 7.145933
[8] 10.781263 7.824216 7.865966
> rowMax(tmp5)
[1] 468.58936 80.50158 86.28699 93.43086 90.63644 NA 84.53821
[8] 91.78567 86.08657 90.10602
> rowMin(tmp5)
[1] 59.00943 56.58272 58.08399 61.46936 55.96551 NA 60.12704 54.58089
[9] 58.24917 56.07734
>
> colMeans(tmp5)
[1] 110.79459 72.53530 71.35570 NA 70.28239 69.30726 71.11504
[8] 69.52729 70.67390 69.14807 69.39816 71.82631 69.98381 69.05819
[15] 71.55497 70.54928 71.71181 75.62994 72.60187 75.83033
> colSums(tmp5)
[1] 1107.9459 725.3530 713.5570 NA 702.8239 693.0726 711.1504
[8] 695.2729 706.7390 691.4807 693.9816 718.2631 699.8381 690.5819
[15] 715.5497 705.4928 717.1181 756.2994 726.0187 758.3033
> colVars(tmp5)
[1] 15846.09727 52.81670 59.79819 NA 114.45197 36.39808
[7] 130.83164 76.93452 60.02634 35.90208 115.12771 78.45613
[13] 55.23166 61.88710 48.99684 76.12815 139.61123 36.48540
[19] 80.08121 54.37886
> colSd(tmp5)
[1] 125.881282 7.267510 7.732929 NA 10.698223 6.033082
[7] 11.438166 8.771232 7.747667 5.991835 10.729758 8.857547
[13] 7.431800 7.866836 6.999774 8.725145 11.815720 6.040314
[19] 8.948811 7.374202
> colMax(tmp5)
[1] 468.58936 85.03539 80.98286 NA 90.10602 79.54683 90.63644
[8] 89.86233 81.49002 78.93526 91.78567 84.33042 80.78160 89.18801
[15] 78.90013 81.35877 93.43086 87.05780 86.28699 83.95361
> colMin(tmp5)
[1] 63.11062 59.54650 57.90555 NA 56.58272 61.68735 56.07734 58.86618
[9] 55.96551 58.58615 58.08399 58.31333 61.46936 61.81426 59.00943 54.58089
[17] 58.77287 65.20180 57.59272 60.36640
>
> Max(tmp5,na.rm=TRUE)
[1] 468.5894
> Min(tmp5,na.rm=TRUE)
[1] 54.58089
> mean(tmp5,na.rm=TRUE)
[1] 73.16444
> Sum(tmp5,na.rm=TRUE)
[1] 14559.72
> Var(tmp5,na.rm=TRUE)
[1] 861.8292
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.78641 69.70944 72.74411 73.37675 67.07695 74.64236 72.81506 70.93039
[9] 69.54518 71.09169
> rowSums(tmp5,na.rm=TRUE)
[1] 1795.728 1394.189 1454.882 1467.535 1341.539 1418.205 1456.301 1418.608
[9] 1390.904 1421.834
> rowVars(tmp5,na.rm=TRUE)
[1] 7998.12096 53.03034 75.35001 62.71800 66.71593 70.00923
[7] 51.06436 116.23562 61.21835 61.87342
> rowSd(tmp5,na.rm=TRUE)
[1] 89.432214 7.282193 8.680439 7.919470 8.167982 8.367152 7.145933
[8] 10.781263 7.824216 7.865966
> rowMax(tmp5,na.rm=TRUE)
[1] 468.58936 80.50158 86.28699 93.43086 90.63644 89.86233 84.53821
[8] 91.78567 86.08657 90.10602
> rowMin(tmp5,na.rm=TRUE)
[1] 59.00943 56.58272 58.08399 61.46936 55.96551 58.31333 60.12704 54.58089
[9] 58.24917 56.07734
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.79459 72.53530 71.35570 70.09807 70.28239 69.30726 71.11504
[8] 69.52729 70.67390 69.14807 69.39816 71.82631 69.98381 69.05819
[15] 71.55497 70.54928 71.71181 75.62994 72.60187 75.83033
> colSums(tmp5,na.rm=TRUE)
[1] 1107.9459 725.3530 713.5570 630.8826 702.8239 693.0726 711.1504
[8] 695.2729 706.7390 691.4807 693.9816 718.2631 699.8381 690.5819
[15] 715.5497 705.4928 717.1181 756.2994 726.0187 758.3033
> colVars(tmp5,na.rm=TRUE)
[1] 15846.09727 52.81670 59.79819 76.80060 114.45197 36.39808
[7] 130.83164 76.93452 60.02634 35.90208 115.12771 78.45613
[13] 55.23166 61.88710 48.99684 76.12815 139.61123 36.48540
[19] 80.08121 54.37886
> colSd(tmp5,na.rm=TRUE)
[1] 125.881282 7.267510 7.732929 8.763595 10.698223 6.033082
[7] 11.438166 8.771232 7.747667 5.991835 10.729758 8.857547
[13] 7.431800 7.866836 6.999774 8.725145 11.815720 6.040314
[19] 8.948811 7.374202
> colMax(tmp5,na.rm=TRUE)
[1] 468.58936 85.03539 80.98286 83.27256 90.10602 79.54683 90.63644
[8] 89.86233 81.49002 78.93526 91.78567 84.33042 80.78160 89.18801
[15] 78.90013 81.35877 93.43086 87.05780 86.28699 83.95361
> colMin(tmp5,na.rm=TRUE)
[1] 63.11062 59.54650 57.90555 58.24917 56.58272 61.68735 56.07734 58.86618
[9] 55.96551 58.58615 58.08399 58.31333 61.46936 61.81426 59.00943 54.58089
[17] 58.77287 65.20180 57.59272 60.36640
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.78641 69.70944 72.74411 73.37675 67.07695 NaN 72.81506 70.93039
[9] 69.54518 71.09169
> rowSums(tmp5,na.rm=TRUE)
[1] 1795.728 1394.189 1454.882 1467.535 1341.539 0.000 1456.301 1418.608
[9] 1390.904 1421.834
> rowVars(tmp5,na.rm=TRUE)
[1] 7998.12096 53.03034 75.35001 62.71800 66.71593 NA
[7] 51.06436 116.23562 61.21835 61.87342
> rowSd(tmp5,na.rm=TRUE)
[1] 89.432214 7.282193 8.680439 7.919470 8.167982 NA 7.145933
[8] 10.781263 7.824216 7.865966
> rowMax(tmp5,na.rm=TRUE)
[1] 468.58936 80.50158 86.28699 93.43086 90.63644 NA 84.53821
[8] 91.78567 86.08657 90.10602
> rowMin(tmp5,na.rm=TRUE)
[1] 59.00943 56.58272 58.08399 61.46936 55.96551 NA 60.12704 54.58089
[9] 58.24917 56.07734
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 114.31590 72.61813 70.40006 NaN 69.77187 68.46730 70.95903
[8] 67.26784 70.62686 68.06061 70.48738 73.32775 68.78405 69.48854
[15] 71.76917 70.03138 71.29067 74.36017 73.11631 74.92774
> colSums(tmp5,na.rm=TRUE)
[1] 1028.8431 653.5632 633.6006 0.0000 627.9468 616.2057 638.6313
[8] 605.4106 635.6418 612.5455 634.3864 659.9498 619.0565 625.3969
[15] 645.9225 630.2824 641.6160 669.2416 658.0468 674.3497
> colVars(tmp5,na.rm=TRUE)
[1] 17687.36334 59.34160 56.99889 NA 125.82639 33.01066
[7] 146.91179 29.11886 67.50475 27.08582 116.17178 62.90195
[13] 45.94223 67.53943 54.60526 82.62678 155.06732 22.90772
[19] 87.11399 52.01127
> colSd(tmp5,na.rm=TRUE)
[1] 132.993847 7.703350 7.549761 NA 11.217236 5.745490
[7] 12.120717 5.396189 8.216127 5.204404 10.778301 7.931075
[13] 6.778070 8.218238 7.389537 9.089927 12.452603 4.786201
[19] 9.333487 7.211884
> colMax(tmp5,na.rm=TRUE)
[1] 468.58936 85.03539 80.98286 -Inf 90.10602 79.54683 90.63644
[8] 74.52060 81.49002 76.04064 91.78567 84.33042 80.63337 89.18801
[15] 78.90013 81.35877 93.43086 80.33816 86.28699 82.24690
> colMin(tmp5,na.rm=TRUE)
[1] 63.11062 59.54650 57.90555 Inf 56.58272 61.68735 56.07734 58.86618
[9] 55.96551 58.58615 58.08399 59.83958 61.46936 61.81426 59.00943 54.58089
[17] 58.77287 65.20180 57.59272 60.36640
>
>
>
>
> 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] 204.1506 327.9234 218.2610 201.2967 174.8471 214.8357 159.3100 145.2573
[9] 191.6390 140.0475
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 204.1506 327.9234 218.2610 201.2967 174.8471 214.8357 159.3100 145.2573
[9] 191.6390 140.0475
>
>
>
> 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 0.000000e+00 -2.842171e-14 0.000000e+00 5.684342e-14
[6] -1.136868e-13 -1.136868e-13 -2.273737e-13 5.684342e-14 1.421085e-13
[11] 0.000000e+00 5.684342e-14 -5.684342e-14 -5.684342e-14 1.136868e-13
[16] -5.684342e-14 -5.684342e-14 1.705303e-13 0.000000e+00 1.136868e-13
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
2 15
8 13
3 18
7 5
6 4
4 11
7 15
10 13
10 11
7 19
3 7
9 13
6 12
1 2
2 5
3 3
3 16
1 5
9 13
7 10
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.138194
> Min(tmp)
[1] -2.409885
> mean(tmp)
[1] -0.09695154
> Sum(tmp)
[1] -9.695154
> Var(tmp)
[1] 1.04614
>
> rowMeans(tmp)
[1] -0.09695154
> rowSums(tmp)
[1] -9.695154
> rowVars(tmp)
[1] 1.04614
> rowSd(tmp)
[1] 1.02281
> rowMax(tmp)
[1] 2.138194
> rowMin(tmp)
[1] -2.409885
>
> colMeans(tmp)
[1] 0.098389048 0.378481802 -0.202667569 -0.635950218 0.285539352
[6] 0.981261952 -1.198360935 0.452582435 -0.945042466 0.374979692
[11] 0.327633592 0.106220184 1.546870731 1.348418883 -2.400860563
[16] -0.233061996 2.137580466 -0.628969057 -0.874460776 0.138006121
[21] 0.579352554 -0.405258384 1.475469629 0.001980374 0.824164652
[26] -0.385481295 -0.646944401 0.449240016 0.089950597 -0.977544534
[31] 0.411875738 0.968248885 0.730030475 -0.292066997 -2.409884771
[36] -1.411733898 -0.689521912 0.720283727 -1.226722249 0.927735660
[41] -2.064001672 -1.040726882 0.244637372 -2.307113592 0.126521253
[46] 1.625920686 0.374714123 0.685015944 0.131042472 1.106011041
[51] 1.555673897 -1.295326482 -2.312667838 1.573129745 1.067908249
[56] 1.429374926 -0.203592179 0.692950743 -0.924206599 -0.104385045
[61] 0.077806308 -0.903364534 -0.585652738 0.971754597 -1.025399893
[66] 0.908706076 1.320846875 0.209530069 2.138194401 -0.980373163
[71] 0.018585512 -1.220709417 0.033165216 0.708643576 -0.818862917
[76] -0.402045392 -1.360324455 -1.399680609 -1.304611072 0.123145869
[81] -0.502481604 1.260465542 -0.269846548 -0.094363408 0.059505815
[86] -0.653477138 -0.526144906 -0.281346554 -0.511268158 -0.406371148
[91] -0.554345834 -0.279224524 -1.067750800 1.309329658 -0.796853496
[96] -1.550737922 0.107825436 -2.264679690 0.056516836 0.610095538
> colSums(tmp)
[1] 0.098389048 0.378481802 -0.202667569 -0.635950218 0.285539352
[6] 0.981261952 -1.198360935 0.452582435 -0.945042466 0.374979692
[11] 0.327633592 0.106220184 1.546870731 1.348418883 -2.400860563
[16] -0.233061996 2.137580466 -0.628969057 -0.874460776 0.138006121
[21] 0.579352554 -0.405258384 1.475469629 0.001980374 0.824164652
[26] -0.385481295 -0.646944401 0.449240016 0.089950597 -0.977544534
[31] 0.411875738 0.968248885 0.730030475 -0.292066997 -2.409884771
[36] -1.411733898 -0.689521912 0.720283727 -1.226722249 0.927735660
[41] -2.064001672 -1.040726882 0.244637372 -2.307113592 0.126521253
[46] 1.625920686 0.374714123 0.685015944 0.131042472 1.106011041
[51] 1.555673897 -1.295326482 -2.312667838 1.573129745 1.067908249
[56] 1.429374926 -0.203592179 0.692950743 -0.924206599 -0.104385045
[61] 0.077806308 -0.903364534 -0.585652738 0.971754597 -1.025399893
[66] 0.908706076 1.320846875 0.209530069 2.138194401 -0.980373163
[71] 0.018585512 -1.220709417 0.033165216 0.708643576 -0.818862917
[76] -0.402045392 -1.360324455 -1.399680609 -1.304611072 0.123145869
[81] -0.502481604 1.260465542 -0.269846548 -0.094363408 0.059505815
[86] -0.653477138 -0.526144906 -0.281346554 -0.511268158 -0.406371148
[91] -0.554345834 -0.279224524 -1.067750800 1.309329658 -0.796853496
[96] -1.550737922 0.107825436 -2.264679690 0.056516836 0.610095538
> 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.098389048 0.378481802 -0.202667569 -0.635950218 0.285539352
[6] 0.981261952 -1.198360935 0.452582435 -0.945042466 0.374979692
[11] 0.327633592 0.106220184 1.546870731 1.348418883 -2.400860563
[16] -0.233061996 2.137580466 -0.628969057 -0.874460776 0.138006121
[21] 0.579352554 -0.405258384 1.475469629 0.001980374 0.824164652
[26] -0.385481295 -0.646944401 0.449240016 0.089950597 -0.977544534
[31] 0.411875738 0.968248885 0.730030475 -0.292066997 -2.409884771
[36] -1.411733898 -0.689521912 0.720283727 -1.226722249 0.927735660
[41] -2.064001672 -1.040726882 0.244637372 -2.307113592 0.126521253
[46] 1.625920686 0.374714123 0.685015944 0.131042472 1.106011041
[51] 1.555673897 -1.295326482 -2.312667838 1.573129745 1.067908249
[56] 1.429374926 -0.203592179 0.692950743 -0.924206599 -0.104385045
[61] 0.077806308 -0.903364534 -0.585652738 0.971754597 -1.025399893
[66] 0.908706076 1.320846875 0.209530069 2.138194401 -0.980373163
[71] 0.018585512 -1.220709417 0.033165216 0.708643576 -0.818862917
[76] -0.402045392 -1.360324455 -1.399680609 -1.304611072 0.123145869
[81] -0.502481604 1.260465542 -0.269846548 -0.094363408 0.059505815
[86] -0.653477138 -0.526144906 -0.281346554 -0.511268158 -0.406371148
[91] -0.554345834 -0.279224524 -1.067750800 1.309329658 -0.796853496
[96] -1.550737922 0.107825436 -2.264679690 0.056516836 0.610095538
> colMin(tmp)
[1] 0.098389048 0.378481802 -0.202667569 -0.635950218 0.285539352
[6] 0.981261952 -1.198360935 0.452582435 -0.945042466 0.374979692
[11] 0.327633592 0.106220184 1.546870731 1.348418883 -2.400860563
[16] -0.233061996 2.137580466 -0.628969057 -0.874460776 0.138006121
[21] 0.579352554 -0.405258384 1.475469629 0.001980374 0.824164652
[26] -0.385481295 -0.646944401 0.449240016 0.089950597 -0.977544534
[31] 0.411875738 0.968248885 0.730030475 -0.292066997 -2.409884771
[36] -1.411733898 -0.689521912 0.720283727 -1.226722249 0.927735660
[41] -2.064001672 -1.040726882 0.244637372 -2.307113592 0.126521253
[46] 1.625920686 0.374714123 0.685015944 0.131042472 1.106011041
[51] 1.555673897 -1.295326482 -2.312667838 1.573129745 1.067908249
[56] 1.429374926 -0.203592179 0.692950743 -0.924206599 -0.104385045
[61] 0.077806308 -0.903364534 -0.585652738 0.971754597 -1.025399893
[66] 0.908706076 1.320846875 0.209530069 2.138194401 -0.980373163
[71] 0.018585512 -1.220709417 0.033165216 0.708643576 -0.818862917
[76] -0.402045392 -1.360324455 -1.399680609 -1.304611072 0.123145869
[81] -0.502481604 1.260465542 -0.269846548 -0.094363408 0.059505815
[86] -0.653477138 -0.526144906 -0.281346554 -0.511268158 -0.406371148
[91] -0.554345834 -0.279224524 -1.067750800 1.309329658 -0.796853496
[96] -1.550737922 0.107825436 -2.264679690 0.056516836 0.610095538
> colMedians(tmp)
[1] 0.098389048 0.378481802 -0.202667569 -0.635950218 0.285539352
[6] 0.981261952 -1.198360935 0.452582435 -0.945042466 0.374979692
[11] 0.327633592 0.106220184 1.546870731 1.348418883 -2.400860563
[16] -0.233061996 2.137580466 -0.628969057 -0.874460776 0.138006121
[21] 0.579352554 -0.405258384 1.475469629 0.001980374 0.824164652
[26] -0.385481295 -0.646944401 0.449240016 0.089950597 -0.977544534
[31] 0.411875738 0.968248885 0.730030475 -0.292066997 -2.409884771
[36] -1.411733898 -0.689521912 0.720283727 -1.226722249 0.927735660
[41] -2.064001672 -1.040726882 0.244637372 -2.307113592 0.126521253
[46] 1.625920686 0.374714123 0.685015944 0.131042472 1.106011041
[51] 1.555673897 -1.295326482 -2.312667838 1.573129745 1.067908249
[56] 1.429374926 -0.203592179 0.692950743 -0.924206599 -0.104385045
[61] 0.077806308 -0.903364534 -0.585652738 0.971754597 -1.025399893
[66] 0.908706076 1.320846875 0.209530069 2.138194401 -0.980373163
[71] 0.018585512 -1.220709417 0.033165216 0.708643576 -0.818862917
[76] -0.402045392 -1.360324455 -1.399680609 -1.304611072 0.123145869
[81] -0.502481604 1.260465542 -0.269846548 -0.094363408 0.059505815
[86] -0.653477138 -0.526144906 -0.281346554 -0.511268158 -0.406371148
[91] -0.554345834 -0.279224524 -1.067750800 1.309329658 -0.796853496
[96] -1.550737922 0.107825436 -2.264679690 0.056516836 0.610095538
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.09838905 0.3784818 -0.2026676 -0.6359502 0.2855394 0.981262 -1.198361
[2,] 0.09838905 0.3784818 -0.2026676 -0.6359502 0.2855394 0.981262 -1.198361
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.4525824 -0.9450425 0.3749797 0.3276336 0.1062202 1.546871 1.348419
[2,] 0.4525824 -0.9450425 0.3749797 0.3276336 0.1062202 1.546871 1.348419
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -2.400861 -0.233062 2.13758 -0.6289691 -0.8744608 0.1380061 0.5793526
[2,] -2.400861 -0.233062 2.13758 -0.6289691 -0.8744608 0.1380061 0.5793526
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.4052584 1.47547 0.001980374 0.8241647 -0.3854813 -0.6469444 0.44924
[2,] -0.4052584 1.47547 0.001980374 0.8241647 -0.3854813 -0.6469444 0.44924
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.0899506 -0.9775445 0.4118757 0.9682489 0.7300305 -0.292067 -2.409885
[2,] 0.0899506 -0.9775445 0.4118757 0.9682489 0.7300305 -0.292067 -2.409885
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.411734 -0.6895219 0.7202837 -1.226722 0.9277357 -2.064002 -1.040727
[2,] -1.411734 -0.6895219 0.7202837 -1.226722 0.9277357 -2.064002 -1.040727
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.2446374 -2.307114 0.1265213 1.625921 0.3747141 0.6850159 0.1310425
[2,] 0.2446374 -2.307114 0.1265213 1.625921 0.3747141 0.6850159 0.1310425
[,50] [,51] [,52] [,53] [,54] [,55] [,56] [,57]
[1,] 1.106011 1.555674 -1.295326 -2.312668 1.57313 1.067908 1.429375 -0.2035922
[2,] 1.106011 1.555674 -1.295326 -2.312668 1.57313 1.067908 1.429375 -0.2035922
[,58] [,59] [,60] [,61] [,62] [,63] [,64]
[1,] 0.6929507 -0.9242066 -0.104385 0.07780631 -0.9033645 -0.5856527 0.9717546
[2,] 0.6929507 -0.9242066 -0.104385 0.07780631 -0.9033645 -0.5856527 0.9717546
[,65] [,66] [,67] [,68] [,69] [,70] [,71]
[1,] -1.0254 0.9087061 1.320847 0.2095301 2.138194 -0.9803732 0.01858551
[2,] -1.0254 0.9087061 1.320847 0.2095301 2.138194 -0.9803732 0.01858551
[,72] [,73] [,74] [,75] [,76] [,77] [,78]
[1,] -1.220709 0.03316522 0.7086436 -0.8188629 -0.4020454 -1.360324 -1.399681
[2,] -1.220709 0.03316522 0.7086436 -0.8188629 -0.4020454 -1.360324 -1.399681
[,79] [,80] [,81] [,82] [,83] [,84] [,85]
[1,] -1.304611 0.1231459 -0.5024816 1.260466 -0.2698465 -0.09436341 0.05950582
[2,] -1.304611 0.1231459 -0.5024816 1.260466 -0.2698465 -0.09436341 0.05950582
[,86] [,87] [,88] [,89] [,90] [,91]
[1,] -0.6534771 -0.5261449 -0.2813466 -0.5112682 -0.4063711 -0.5543458
[2,] -0.6534771 -0.5261449 -0.2813466 -0.5112682 -0.4063711 -0.5543458
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.2792245 -1.067751 1.30933 -0.7968535 -1.550738 0.1078254 -2.26468
[2,] -0.2792245 -1.067751 1.30933 -0.7968535 -1.550738 0.1078254 -2.26468
[,99] [,100]
[1,] 0.05651684 0.6100955
[2,] 0.05651684 0.6100955
>
>
> Max(tmp2)
[1] 2.205719
> Min(tmp2)
[1] -2.28014
> mean(tmp2)
[1] -0.05132098
> Sum(tmp2)
[1] -5.132098
> Var(tmp2)
[1] 0.9249753
>
> rowMeans(tmp2)
[1] -0.65322920 -0.60187526 -0.28336404 -1.07088106 -0.15696012 0.56431751
[7] 1.00441979 1.06786713 -0.98680776 -0.57519360 0.11878903 -1.80186833
[13] 0.61621908 -0.15063455 -1.08745652 -0.61137480 -1.26317404 -0.53572665
[19] -0.51966140 -0.69792309 0.28294358 0.96818935 0.32476239 0.43378683
[25] -1.11490982 -1.68775451 -0.17852842 0.11199787 -0.23280330 0.78381447
[31] -0.85760751 -0.34981875 0.45648747 0.27860623 -0.97598125 -0.02436749
[37] 1.05463806 -0.47518965 -0.23287486 -0.70904300 0.21966862 -1.25604177
[43] -0.14863565 0.14237887 0.70644383 0.25269633 0.69734082 0.33859209
[49] -1.15045555 2.20571940 0.19690859 -0.93867052 1.46754222 0.50810739
[55] 0.70205347 -1.56488994 0.52231064 1.13368272 1.84276134 0.08063875
[61] -1.34859665 -0.39379245 0.96366623 -1.68585613 -0.38236223 -1.91255857
[67] 0.26091812 -1.54986689 1.05320393 0.07614631 -1.05809151 -2.28013973
[73] 0.62821063 -0.43986569 0.65906950 0.59061388 0.60757802 1.77656674
[79] 0.13855974 -0.48890874 0.08625339 -1.36200841 1.34862844 0.20490688
[85] 1.20358628 1.53557948 0.90949746 -1.11018365 -1.48993613 1.75962403
[91] -0.37175752 -0.70782660 1.90276027 -1.42574822 -0.73902011 -0.01480634
[97] 1.05328014 0.17570370 -0.04889352 0.55378628
> rowSums(tmp2)
[1] -0.65322920 -0.60187526 -0.28336404 -1.07088106 -0.15696012 0.56431751
[7] 1.00441979 1.06786713 -0.98680776 -0.57519360 0.11878903 -1.80186833
[13] 0.61621908 -0.15063455 -1.08745652 -0.61137480 -1.26317404 -0.53572665
[19] -0.51966140 -0.69792309 0.28294358 0.96818935 0.32476239 0.43378683
[25] -1.11490982 -1.68775451 -0.17852842 0.11199787 -0.23280330 0.78381447
[31] -0.85760751 -0.34981875 0.45648747 0.27860623 -0.97598125 -0.02436749
[37] 1.05463806 -0.47518965 -0.23287486 -0.70904300 0.21966862 -1.25604177
[43] -0.14863565 0.14237887 0.70644383 0.25269633 0.69734082 0.33859209
[49] -1.15045555 2.20571940 0.19690859 -0.93867052 1.46754222 0.50810739
[55] 0.70205347 -1.56488994 0.52231064 1.13368272 1.84276134 0.08063875
[61] -1.34859665 -0.39379245 0.96366623 -1.68585613 -0.38236223 -1.91255857
[67] 0.26091812 -1.54986689 1.05320393 0.07614631 -1.05809151 -2.28013973
[73] 0.62821063 -0.43986569 0.65906950 0.59061388 0.60757802 1.77656674
[79] 0.13855974 -0.48890874 0.08625339 -1.36200841 1.34862844 0.20490688
[85] 1.20358628 1.53557948 0.90949746 -1.11018365 -1.48993613 1.75962403
[91] -0.37175752 -0.70782660 1.90276027 -1.42574822 -0.73902011 -0.01480634
[97] 1.05328014 0.17570370 -0.04889352 0.55378628
> 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.65322920 -0.60187526 -0.28336404 -1.07088106 -0.15696012 0.56431751
[7] 1.00441979 1.06786713 -0.98680776 -0.57519360 0.11878903 -1.80186833
[13] 0.61621908 -0.15063455 -1.08745652 -0.61137480 -1.26317404 -0.53572665
[19] -0.51966140 -0.69792309 0.28294358 0.96818935 0.32476239 0.43378683
[25] -1.11490982 -1.68775451 -0.17852842 0.11199787 -0.23280330 0.78381447
[31] -0.85760751 -0.34981875 0.45648747 0.27860623 -0.97598125 -0.02436749
[37] 1.05463806 -0.47518965 -0.23287486 -0.70904300 0.21966862 -1.25604177
[43] -0.14863565 0.14237887 0.70644383 0.25269633 0.69734082 0.33859209
[49] -1.15045555 2.20571940 0.19690859 -0.93867052 1.46754222 0.50810739
[55] 0.70205347 -1.56488994 0.52231064 1.13368272 1.84276134 0.08063875
[61] -1.34859665 -0.39379245 0.96366623 -1.68585613 -0.38236223 -1.91255857
[67] 0.26091812 -1.54986689 1.05320393 0.07614631 -1.05809151 -2.28013973
[73] 0.62821063 -0.43986569 0.65906950 0.59061388 0.60757802 1.77656674
[79] 0.13855974 -0.48890874 0.08625339 -1.36200841 1.34862844 0.20490688
[85] 1.20358628 1.53557948 0.90949746 -1.11018365 -1.48993613 1.75962403
[91] -0.37175752 -0.70782660 1.90276027 -1.42574822 -0.73902011 -0.01480634
[97] 1.05328014 0.17570370 -0.04889352 0.55378628
> rowMin(tmp2)
[1] -0.65322920 -0.60187526 -0.28336404 -1.07088106 -0.15696012 0.56431751
[7] 1.00441979 1.06786713 -0.98680776 -0.57519360 0.11878903 -1.80186833
[13] 0.61621908 -0.15063455 -1.08745652 -0.61137480 -1.26317404 -0.53572665
[19] -0.51966140 -0.69792309 0.28294358 0.96818935 0.32476239 0.43378683
[25] -1.11490982 -1.68775451 -0.17852842 0.11199787 -0.23280330 0.78381447
[31] -0.85760751 -0.34981875 0.45648747 0.27860623 -0.97598125 -0.02436749
[37] 1.05463806 -0.47518965 -0.23287486 -0.70904300 0.21966862 -1.25604177
[43] -0.14863565 0.14237887 0.70644383 0.25269633 0.69734082 0.33859209
[49] -1.15045555 2.20571940 0.19690859 -0.93867052 1.46754222 0.50810739
[55] 0.70205347 -1.56488994 0.52231064 1.13368272 1.84276134 0.08063875
[61] -1.34859665 -0.39379245 0.96366623 -1.68585613 -0.38236223 -1.91255857
[67] 0.26091812 -1.54986689 1.05320393 0.07614631 -1.05809151 -2.28013973
[73] 0.62821063 -0.43986569 0.65906950 0.59061388 0.60757802 1.77656674
[79] 0.13855974 -0.48890874 0.08625339 -1.36200841 1.34862844 0.20490688
[85] 1.20358628 1.53557948 0.90949746 -1.11018365 -1.48993613 1.75962403
[91] -0.37175752 -0.70782660 1.90276027 -1.42574822 -0.73902011 -0.01480634
[97] 1.05328014 0.17570370 -0.04889352 0.55378628
>
> colMeans(tmp2)
[1] -0.05132098
> colSums(tmp2)
[1] -5.132098
> colVars(tmp2)
[1] 0.9249753
> colSd(tmp2)
[1] 0.9617564
> colMax(tmp2)
[1] 2.205719
> colMin(tmp2)
[1] -2.28014
> colMedians(tmp2)
[1] 0.03066999
> colRanges(tmp2)
[,1]
[1,] -2.280140
[2,] 2.205719
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] -4.8657687 4.0771231 6.2762107 -0.5188470 0.1950098 -5.7815399
[7] -2.8676270 -0.1112141 4.4484640 7.5376233
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.1507738
[2,] -1.0424355
[3,] -0.8757960
[4,] -0.0373575
[5,] 1.0504292
>
> rowApply(tmp,sum)
[1] 3.1059035 -2.7969600 -3.8397499 2.3461701 4.8565537 -1.9573385
[7] 6.9217654 -2.9611211 2.5873555 0.1268554
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 4 3 8 1 8 2 2 7 3
[2,] 1 5 6 10 7 4 9 9 3 9
[3,] 5 9 10 1 5 10 8 10 9 5
[4,] 8 7 9 6 2 1 10 1 5 7
[5,] 6 8 8 3 4 2 6 4 6 6
[6,] 2 2 2 7 6 5 1 5 2 1
[7,] 3 1 4 2 3 7 4 8 8 4
[8,] 7 3 1 5 10 3 3 7 4 8
[9,] 9 6 7 9 8 6 5 3 1 10
[10,] 10 10 5 4 9 9 7 6 10 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.7477822 1.0410996 0.2974368 -3.3911641 -0.6326101 1.4252865
[7] 2.8581391 -1.0639994 0.2967252 -0.9787360 -2.2995656 -0.8349290
[13] 1.6332668 -1.1659159 -1.2866196 -0.3126868 2.4105155 -0.6883660
[19] 0.6660574 -2.3519553
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.5527282
[2,] -0.3694971
[3,] 0.8363606
[4,] 1.2692568
[5,] 1.5643902
>
> rowApply(tmp,sum)
[1] -0.7886730 -2.5512023 0.6090719 -0.5620022 1.6625667
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 6 19 15 8 18
[2,] 10 17 6 15 13
[3,] 15 10 11 16 8
[4,] 13 15 2 6 1
[5,] 9 16 1 13 12
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.3694971 -0.1012208 0.4552134 0.2282066 -0.1351907 1.1094539150
[2,] 1.5643902 0.7428163 -0.3084225 0.1155780 0.2908153 2.1427792534
[3,] 0.8363606 -0.5411081 -0.3287102 -1.2756117 -1.4481779 -0.0008140507
[4,] -0.5527282 0.7760651 0.8754990 -0.6762698 0.5073279 -0.3505776610
[5,] 1.2692568 0.1645472 -0.3961431 -1.7830673 0.1526153 -1.4755549537
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.344753502 -0.01756342 1.80904441 -1.6909102 -0.24181095 -2.3249862
[2,] -0.000382569 -1.29641283 -0.41225807 1.2335669 0.05175253 -0.5194408
[3,] 1.318889482 -0.36931126 -0.26124950 -0.9608463 -0.46065884 2.2429516
[4,] -0.682910027 1.02055788 -0.90892901 0.9357446 -0.74108818 0.5860634
[5,] 1.877788705 -0.40126980 0.07011735 -0.4962910 -0.90776019 -0.8195170
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.1629115 0.5585651 -1.4587020 -1.2290197 0.7036584 0.1319848
[2,] -0.5635344 -0.7645900 -2.0001027 -0.4430564 -0.9950990 -0.1342917
[3,] -0.4148726 -0.3968653 0.9507937 -0.7551441 1.2456856 0.5277556
[4,] -0.2080579 -1.4276442 0.4708696 1.5686317 0.8951273 -0.3779594
[5,] 2.9826432 0.8646184 0.7505217 0.5459018 0.5611432 -0.8358552
[,19] [,20]
[1,] 2.5684474 -0.96618796
[2,] -1.1988505 -0.05645931
[3,] 1.2910852 -0.59107992
[4,] -1.6447823 -0.62694209
[5,] -0.3498424 -0.11128607
>
>
> 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.22-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.22-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: /home/biocbuild/bbs-3.22-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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.6992313 -0.6981678 0.5057635 0.3307091 -0.854821 -0.8949905 -0.5450385
col8 col9 col10 col11 col12 col13 col14
row1 -1.480253 1.247953 -0.889963 0.3868045 0.06608123 -0.2450445 0.5401801
col15 col16 col17 col18 col19 col20
row1 -1.266913 0.3677799 0.1259724 -0.3590267 0.1801068 0.1056254
> tmp[,"col10"]
col10
row1 -0.8899630
row2 0.5660895
row3 3.7715033
row4 -0.3118279
row5 0.4055361
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.6992313 -0.6981678 0.5057635 0.33070912 -0.8548210 -0.8949905
row5 0.1469490 1.0091068 0.9238160 0.06837246 0.6505573 -1.3284031
col7 col8 col9 col10 col11 col12
row1 -0.5450385 -1.48025328 1.2479528 -0.8899630 0.3868045 0.06608123
row5 1.0439047 0.01526216 -0.7621527 0.4055361 0.4892272 0.15296683
col13 col14 col15 col16 col17 col18 col19
row1 -0.2450445 0.5401801 -1.2669129 0.3677799 0.1259724 -0.3590267 0.1801068
row5 0.6896133 0.1612304 -0.6380441 0.5807528 -1.8575537 1.3221651 3.4326830
col20
row1 0.1056254
row5 0.9468062
> tmp[,c("col6","col20")]
col6 col20
row1 -0.8949905 0.1056254
row2 2.4375451 -0.1841754
row3 -1.5975957 0.2674763
row4 -0.7412981 -0.8258656
row5 -1.3284031 0.9468062
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.8949905 0.1056254
row5 -1.3284031 0.9468062
>
>
>
>
> 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.28408 50.06636 49.8436 50.05219 52.35192 105.179 50.92404 48.34503
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.44248 49.34352 50.77647 50.53784 50.42882 48.39034 50.90363 50.52668
col17 col18 col19 col20
row1 51.39685 49.62266 48.72497 103.9699
> tmp[,"col10"]
col10
row1 49.34352
row2 30.48905
row3 28.90472
row4 29.36785
row5 52.09483
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.28408 50.06636 49.84360 50.05219 52.35192 105.1790 50.92404 48.34503
row5 48.85528 52.29201 52.15612 50.64754 51.24405 103.6699 50.07756 51.20789
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.44248 49.34352 50.77647 50.53784 50.42882 48.39034 50.90363 50.52668
row5 49.67149 52.09483 48.41655 49.46411 49.36276 50.16917 50.19377 49.72520
col17 col18 col19 col20
row1 51.39685 49.62266 48.72497 103.9699
row5 49.42203 49.54192 51.42443 105.0049
> tmp[,c("col6","col20")]
col6 col20
row1 105.17899 103.96993
row2 74.53478 75.58861
row3 75.46083 73.99071
row4 74.50527 75.00106
row5 103.66995 105.00492
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 105.1790 103.9699
row5 103.6699 105.0049
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 105.1790 103.9699
row5 103.6699 105.0049
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.2742747
[2,] 1.0905971
[3,] 1.9945061
[4,] -0.2876685
[5,] -1.2395659
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.5888509 0.99586919
[2,] -0.5128330 2.02843198
[3,] -0.5150214 -0.07771606
[4,] -0.2632103 -0.12744710
[5,] 1.6277809 -0.04198946
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.86868373 -0.51975999
[2,] 0.02691405 0.72149142
[3,] 0.04981677 -0.42167953
[4,] 1.05437767 -0.08523759
[5,] -0.62548420 0.82942929
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.8686837
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.86868373
[2,] 0.02691405
>
>
>
> 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.1142612 -1.02230231 0.2313285 1.0407045 0.6365219 -2.4641505
row1 1.4525005 0.08343445 -0.7152945 -0.3389877 -0.6636836 0.3467104
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.8893572 1.4171598 1.2696328 0.5201174 -1.2690720 2.3467037 0.2280057
row1 -0.3370896 -0.3627557 -0.9396129 -1.0569868 0.9422545 0.7789783 1.7083471
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.01832506 0.6014835 -0.9385416 0.1513559 -0.1561417 0.3026134 -0.6071723
row1 -0.13394407 0.3891426 0.7683165 1.7838950 0.7165866 0.8572791 -0.4753115
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.7129953 -1.097511 -0.2554315 -0.1125475 0.5332592 -1.1876 0.3633294
[,8] [,9] [,10]
row2 -2.244859 0.6181119 0.04710418
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.230663 -0.1781331 0.6570581 0.1940137 -0.7899445 0.3450198 -0.6777654
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -1.892025 -0.8017134 -1.133478 -1.307949 -1.535128 0.6155107 0.07722051
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.1304174 -0.6795621 -0.1136438 0.8468351 1.435765 1.467705
>
>
> 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: 0x34f33690>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee3124e2db"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee4e5ca91"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee6d76d3a2"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee5b2d6031"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee76ed4891"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee6b610541"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee1fb36d1"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee3f83cda5"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee7635589f"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee714f2167"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee636186c7"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee36401b2d"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee5e7d097f"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfee1fbf29fa"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM1cbfeee38fbed"
>
>
> ### 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: 0x36766ee0>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x36766ee0>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x36766ee0>
> rowMedians(tmp)
[1] -0.4678183083 -0.1790213760 0.2150879919 -0.3516234350 0.3168451635
[6] -0.2925853970 0.0826729503 0.1888248237 -0.2485133724 0.3267602176
[11] 0.5150364571 -0.1063685375 -0.2897998856 -0.1610398033 -0.0488348164
[16] -0.2630347645 0.0360664953 -0.3278017901 0.0877884131 0.0972995983
[21] 0.0651475510 -0.0564511661 -0.3537256490 -0.1091857948 -0.4087688793
[26] -0.3482010813 0.6332531788 0.0265972036 -0.0584963860 0.2442148576
[31] 0.1524013492 -0.3453571120 -0.0275586862 0.0011438086 0.1284704508
[36] -0.0106097999 -0.1824474302 0.3491881695 -0.3195837814 -0.3175753817
[41] 0.1903821525 0.0518334916 -0.0705942924 0.6479200851 0.1302572850
[46] -0.4446255344 0.1416307881 0.7922553853 0.2415675038 0.2286624575
[51] -0.0002763218 0.2177182201 -0.0910221781 0.0999449086 -0.3088772607
[56] 0.0417513121 0.2682657083 -0.0228188547 -0.5609542717 -0.1541826008
[61] 0.1003987045 0.0105204547 0.0670832756 0.1528584878 0.0359299800
[66] -0.5150182096 -0.6951902618 -0.0101674033 0.2270428312 -0.1637677294
[71] 0.1326766901 -0.5385680054 -0.3084405425 -0.1451502146 -0.1985574395
[76] -0.3180881577 0.1410805731 0.1161647991 -0.0459777243 0.0702906470
[81] -0.0634209380 -0.3101398535 -0.3949374591 0.0661474946 0.4845236293
[86] 0.5376340134 0.4245824269 -0.2738904730 0.0166373152 0.0301498175
[91] -0.4592372942 -0.0428175088 -0.0851121204 0.1891762664 -0.2632400241
[96] 0.0519745567 0.1039750532 0.0107933776 0.3486703109 0.1342314364
[101] 0.0806653227 0.0146090257 -0.0030087257 0.0011385727 -0.0947991878
[106] -0.0926240843 0.4150393231 0.1728817838 0.0405033448 0.1860339426
[111] -0.2921084047 0.4837281640 0.2279969172 0.2764133748 0.2459316968
[116] 0.1214451992 0.3629273657 -0.0785637248 0.4604125656 0.2164707729
[121] -0.0312654964 -0.3281530635 0.0293691881 0.2150566045 -0.1392944378
[126] 0.4847691252 -0.1166625794 -0.6089516537 0.3387363693 -0.0076127033
[131] 0.3659193725 -0.2126139125 0.0008245072 -0.2960922035 -0.0629690141
[136] 0.9044569566 -0.2522809421 0.2384080089 0.3767813161 0.2344281484
[141] -0.5292280135 -0.5951996647 -0.3745193955 -0.1046077526 0.1935765987
[146] 0.4672376429 0.2133330981 -0.0712669717 0.0686263061 0.5148592656
[151] -0.6510450318 0.1907890796 -0.2666062414 -0.7844007497 0.6455128462
[156] -0.3370139817 -0.1480359744 0.3045233297 0.1431869291 0.1740623764
[161] 0.3484618373 0.2999470264 0.0292936488 0.0859236795 -0.6132190603
[166] -0.0107005974 -0.0703562598 -0.0740496838 0.4022396491 0.0266986456
[171] 0.3096787508 0.2422101493 -0.2210654408 0.6020655791 0.2392168960
[176] -0.0927092119 0.0091902183 0.4975973739 0.1887417806 -0.4594837066
[181] -0.3324842735 0.2188243128 -0.2896827378 0.4576227956 0.0671751898
[186] -0.3696586311 0.4838392113 0.2411939174 -0.1803066345 -0.0872345911
[191] -0.3000462132 0.4990405150 0.0562659254 0.4568144603 0.1792897069
[196] -0.5053518181 -0.2809247988 0.4197324229 0.7551949634 -0.0826895199
[201] -0.1772154552 -0.1071649704 -0.2794539192 0.2579599872 0.2052654671
[206] -0.0632313753 -0.3136390840 -0.2122943550 0.2854788810 -0.1832649639
[211] 0.2444256423 0.0624175565 -0.4472766658 -0.4614570867 0.4024210219
[216] 0.2972285091 -0.1576645610 0.0036011404 -0.0498936406 -0.1968583663
[221] -0.1500686034 -0.0675704219 0.3079674356 0.0029219861 -0.1279948607
[226] -0.1417014874 -0.2455573668 -0.2347138744 -0.1430736502 0.1371709142
>
> proc.time()
user system elapsed
1.894 0.922 2.841
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 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: 0x323c9ff0>
> .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: 0x323c9ff0>
> .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: 0x323c9ff0>
> .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: 0x323c9ff0>
> 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: 0x322af0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x322af0e0>
> .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: 0x322af0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x322af0e0>
> .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: 0x322af0e0>
> 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: 0x31236520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x31236520>
> .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: 0x31236520>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x31236520>
> .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: 0x31236520>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x31236520>
> .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: 0x31236520>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x31236520>
> .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: 0x31236520>
> 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: 0x30c3a720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x30c3a720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x30c3a720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x30c3a720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1cc0685a456a34" "BufferedMatrixFile1cc0688f77ddf"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile1cc0685a456a34" "BufferedMatrixFile1cc0688f77ddf"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x31b2a7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x31b2a7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x31b2a7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x31b2a7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x31b2a7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x31b2a7d0>
> .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: 0x31c31c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x31c31c90>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x31c31c90>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x31c31c90>
> 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: 0x32eda110>
> .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: 0x32eda110>
> rm(P)
>
> proc.time()
user system elapsed
0.325 0.043 0.352
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 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.341 0.044 0.369