| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-11-20 12:07 -0500 (Thu, 20 Nov 2025).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4615 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 Patched (2025-11-05 r88990) -- "[Not] Part in a Rumble" | 4610 |
| kjohnson1 | macOS 13.7.5 Ventura | arm64 | 4.5.2 Patched (2025-11-04 r88984) -- "[Not] Part in a Rumble" | 4598 |
| 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 | |||||||||
| merida1 | macOS 12.7.6 Monterey / x86_64 | OK | OK | WARNINGS | OK | |||||||||
| kjohnson1 | macOS 13.7.5 Ventura / arm64 | OK | OK | WARNINGS | 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-18 07:47:28 -0000 (Tue, 18 Nov 2025) |
| EndedAt: 2025-11-18 07:47:58 -0000 (Tue, 18 Nov 2025) |
| EllapsedTime: 30.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.344 0.035 0.362
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] "Tue Nov 18 07:47:51 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 Nov 18 07:47:51 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: 0x40466ff0>
>
>
>
> 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 Nov 18 07:47:52 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 Nov 18 07:47:52 2025"
>
> ColMode(tmp2)
<pointer: 0x40466ff0>
>
>
>
> ### 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,] 101.3384718 1.3065138 0.4114815 -0.05533668
[2,] -0.1813582 0.2524380 0.5995882 0.20071604
[3,] -0.5677654 -0.7352156 1.2229414 0.93527633
[4,] -0.2431474 0.9795361 2.1783565 -0.40964082
> 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,] 101.3384718 1.3065138 0.4114815 0.05533668
[2,] 0.1813582 0.2524380 0.5995882 0.20071604
[3,] 0.5677654 0.7352156 1.2229414 0.93527633
[4,] 0.2431474 0.9795361 2.1783565 0.40964082
> 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.0667011 1.1430283 0.6414682 0.2352375
[2,] 0.4258617 0.5024321 0.7743308 0.4480134
[3,] 0.7535021 0.8574471 1.1058668 0.9670969
[4,] 0.4930998 0.9897152 1.4759257 0.6400319
>
> 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,] 227.00548 37.73680 31.82616 27.40771
[2,] 29.43998 30.27676 33.34290 29.68085
[3,] 33.10279 34.30969 37.28161 35.60624
[4,] 30.17415 35.87669 41.93761 31.80996
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3f1496c0>
> exp(tmp5)
<pointer: 0x3f1496c0>
> log(tmp5,2)
<pointer: 0x3f1496c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 472.4822
> Min(tmp5)
[1] 53.57564
> mean(tmp5)
[1] 72.92688
> Sum(tmp5)
[1] 14585.38
> Var(tmp5)
[1] 876.4415
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.09416 68.75341 71.24044 71.23409 73.38054 70.83297 71.82190 69.74428
[9] 72.29894 70.86806
> rowSums(tmp5)
[1] 1781.883 1375.068 1424.809 1424.682 1467.611 1416.659 1436.438 1394.886
[9] 1445.979 1417.361
> rowVars(tmp5)
[1] 8197.96123 89.15157 68.91188 51.27778 80.12368 64.07689
[7] 80.89742 73.40509 74.99418 77.63386
> rowSd(tmp5)
[1] 90.542593 9.442011 8.301318 7.160851 8.951183 8.004804 8.994299
[8] 8.567677 8.659918 8.811008
> rowMax(tmp5)
[1] 472.48217 88.39430 88.01229 87.28765 89.52249 87.23700 88.43770
[8] 81.86309 90.81572 84.88366
> rowMin(tmp5)
[1] 57.04556 56.77434 55.28381 61.13818 58.26551 56.71801 55.12125 55.34179
[9] 54.44873 53.57564
>
> colMeans(tmp5)
[1] 110.59783 69.89406 71.47324 66.21488 72.31709 70.46199 71.89396
[8] 74.96994 73.55383 70.85772 69.61457 74.32756 67.65485 66.12524
[15] 67.76083 69.22322 73.97442 73.32017 72.71103 71.59115
> colSums(tmp5)
[1] 1105.9783 698.9406 714.7324 662.1488 723.1709 704.6199 718.9396
[8] 749.6994 735.5383 708.5772 696.1457 743.2756 676.5485 661.2524
[15] 677.6083 692.2322 739.7442 733.2017 727.1103 715.9115
> colVars(tmp5)
[1] 16235.04982 47.50320 54.19023 30.52260 43.52872 76.66017
[7] 43.42827 64.44020 62.61544 98.68756 90.26895 76.33081
[13] 111.12559 44.55470 79.47912 88.77399 61.36807 102.05292
[19] 51.09328 114.86295
> colSd(tmp5)
[1] 127.416835 6.892257 7.361401 5.524726 6.597630 8.755580
[7] 6.590013 8.027465 7.912992 9.934162 9.500997 8.736750
[13] 10.541612 6.674931 8.915106 9.421995 7.833777 10.102125
[19] 7.147956 10.717413
> colMax(tmp5)
[1] 472.48217 78.54420 87.28765 74.10973 83.78247 83.18502 81.04520
[8] 88.39430 85.75021 89.52249 85.00836 87.23700 84.17156 76.36801
[15] 83.63901 80.97280 88.01229 90.81572 86.66277 88.43770
> colMin(tmp5)
[1] 61.27545 55.34179 61.64732 57.04556 62.34317 56.59548 58.92011 63.45892
[9] 63.03135 58.34896 59.50322 63.40055 53.57564 54.44873 58.26551 56.31152
[17] 63.86677 58.07544 60.41786 55.28381
>
>
> ### 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.09416 68.75341 NA 71.23409 73.38054 70.83297 71.82190 69.74428
[9] 72.29894 70.86806
> rowSums(tmp5)
[1] 1781.883 1375.068 NA 1424.682 1467.611 1416.659 1436.438 1394.886
[9] 1445.979 1417.361
> rowVars(tmp5)
[1] 8197.96123 89.15157 72.71244 51.27778 80.12368 64.07689
[7] 80.89742 73.40509 74.99418 77.63386
> rowSd(tmp5)
[1] 90.542593 9.442011 8.527159 7.160851 8.951183 8.004804 8.994299
[8] 8.567677 8.659918 8.811008
> rowMax(tmp5)
[1] 472.48217 88.39430 NA 87.28765 89.52249 87.23700 88.43770
[8] 81.86309 90.81572 84.88366
> rowMin(tmp5)
[1] 57.04556 56.77434 NA 61.13818 58.26551 56.71801 55.12125 55.34179
[9] 54.44873 53.57564
>
> colMeans(tmp5)
[1] 110.59783 69.89406 71.47324 66.21488 72.31709 70.46199 71.89396
[8] NA 73.55383 70.85772 69.61457 74.32756 67.65485 66.12524
[15] 67.76083 69.22322 73.97442 73.32017 72.71103 71.59115
> colSums(tmp5)
[1] 1105.9783 698.9406 714.7324 662.1488 723.1709 704.6199 718.9396
[8] NA 735.5383 708.5772 696.1457 743.2756 676.5485 661.2524
[15] 677.6083 692.2322 739.7442 733.2017 727.1103 715.9115
> colVars(tmp5)
[1] 16235.04982 47.50320 54.19023 30.52260 43.52872 76.66017
[7] 43.42827 NA 62.61544 98.68756 90.26895 76.33081
[13] 111.12559 44.55470 79.47912 88.77399 61.36807 102.05292
[19] 51.09328 114.86295
> colSd(tmp5)
[1] 127.416835 6.892257 7.361401 5.524726 6.597630 8.755580
[7] 6.590013 NA 7.912992 9.934162 9.500997 8.736750
[13] 10.541612 6.674931 8.915106 9.421995 7.833777 10.102125
[19] 7.147956 10.717413
> colMax(tmp5)
[1] 472.48217 78.54420 87.28765 74.10973 83.78247 83.18502 81.04520
[8] NA 85.75021 89.52249 85.00836 87.23700 84.17156 76.36801
[15] 83.63901 80.97280 88.01229 90.81572 86.66277 88.43770
> colMin(tmp5)
[1] 61.27545 55.34179 61.64732 57.04556 62.34317 56.59548 58.92011 NA
[9] 63.03135 58.34896 59.50322 63.40055 53.57564 54.44873 58.26551 56.31152
[17] 63.86677 58.07544 60.41786 55.28381
>
> Max(tmp5,na.rm=TRUE)
[1] 472.4822
> Min(tmp5,na.rm=TRUE)
[1] 53.57564
> mean(tmp5,na.rm=TRUE)
[1] 72.93188
> Sum(tmp5,na.rm=TRUE)
[1] 14513.44
> Var(tmp5,na.rm=TRUE)
[1] 880.863
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.09416 68.75341 71.20410 71.23409 73.38054 70.83297 71.82190 69.74428
[9] 72.29894 70.86806
> rowSums(tmp5,na.rm=TRUE)
[1] 1781.883 1375.068 1352.878 1424.682 1467.611 1416.659 1436.438 1394.886
[9] 1445.979 1417.361
> rowVars(tmp5,na.rm=TRUE)
[1] 8197.96123 89.15157 72.71244 51.27778 80.12368 64.07689
[7] 80.89742 73.40509 74.99418 77.63386
> rowSd(tmp5,na.rm=TRUE)
[1] 90.542593 9.442011 8.527159 7.160851 8.951183 8.004804 8.994299
[8] 8.567677 8.659918 8.811008
> rowMax(tmp5,na.rm=TRUE)
[1] 472.48217 88.39430 88.01229 87.28765 89.52249 87.23700 88.43770
[8] 81.86309 90.81572 84.88366
> rowMin(tmp5,na.rm=TRUE)
[1] 57.04556 56.77434 55.28381 61.13818 58.26551 56.71801 55.12125 55.34179
[9] 54.44873 53.57564
>
> colMeans(tmp5,na.rm=TRUE)
[1] 110.59783 69.89406 71.47324 66.21488 72.31709 70.46199 71.89396
[8] 75.30762 73.55383 70.85772 69.61457 74.32756 67.65485 66.12524
[15] 67.76083 69.22322 73.97442 73.32017 72.71103 71.59115
> colSums(tmp5,na.rm=TRUE)
[1] 1105.9783 698.9406 714.7324 662.1488 723.1709 704.6199 718.9396
[8] 677.7686 735.5383 708.5772 696.1457 743.2756 676.5485 661.2524
[15] 677.6083 692.2322 739.7442 733.2017 727.1103 715.9115
> colVars(tmp5,na.rm=TRUE)
[1] 16235.04982 47.50320 54.19023 30.52260 43.52872 76.66017
[7] 43.42827 71.21242 62.61544 98.68756 90.26895 76.33081
[13] 111.12559 44.55470 79.47912 88.77399 61.36807 102.05292
[19] 51.09328 114.86295
> colSd(tmp5,na.rm=TRUE)
[1] 127.416835 6.892257 7.361401 5.524726 6.597630 8.755580
[7] 6.590013 8.438745 7.912992 9.934162 9.500997 8.736750
[13] 10.541612 6.674931 8.915106 9.421995 7.833777 10.102125
[19] 7.147956 10.717413
> colMax(tmp5,na.rm=TRUE)
[1] 472.48217 78.54420 87.28765 74.10973 83.78247 83.18502 81.04520
[8] 88.39430 85.75021 89.52249 85.00836 87.23700 84.17156 76.36801
[15] 83.63901 80.97280 88.01229 90.81572 86.66277 88.43770
> colMin(tmp5,na.rm=TRUE)
[1] 61.27545 55.34179 61.64732 57.04556 62.34317 56.59548 58.92011 63.45892
[9] 63.03135 58.34896 59.50322 63.40055 53.57564 54.44873 58.26551 56.31152
[17] 63.86677 58.07544 60.41786 55.28381
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.09416 68.75341 NaN 71.23409 73.38054 70.83297 71.82190 69.74428
[9] 72.29894 70.86806
> rowSums(tmp5,na.rm=TRUE)
[1] 1781.883 1375.068 0.000 1424.682 1467.611 1416.659 1436.438 1394.886
[9] 1445.979 1417.361
> rowVars(tmp5,na.rm=TRUE)
[1] 8197.96123 89.15157 NA 51.27778 80.12368 64.07689
[7] 80.89742 73.40509 74.99418 77.63386
> rowSd(tmp5,na.rm=TRUE)
[1] 90.542593 9.442011 NA 7.160851 8.951183 8.004804 8.994299
[8] 8.567677 8.659918 8.811008
> rowMax(tmp5,na.rm=TRUE)
[1] 472.48217 88.39430 NA 87.28765 89.52249 87.23700 88.43770
[8] 81.86309 90.81572 84.88366
> rowMin(tmp5,na.rm=TRUE)
[1] 57.04556 56.77434 NA 61.13818 58.26551 56.71801 55.12125 55.34179
[9] 54.44873 53.57564
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 115.23103 69.72550 70.79284 65.33767 72.99053 69.58597 73.33550
[8] NaN 74.05128 71.23478 70.68680 74.54996 65.81965 65.91210
[15] 65.99659 68.93871 72.41466 73.89860 73.07235 73.40307
> colSums(tmp5,na.rm=TRUE)
[1] 1037.0792 627.5295 637.1356 588.0390 656.9148 626.2737 660.0195
[8] 0.0000 666.4615 641.1130 636.1812 670.9496 592.3769 593.2089
[15] 593.9693 620.4484 651.7319 665.0874 657.6511 660.6277
> colVars(tmp5,na.rm=TRUE)
[1] 18022.93336 53.12145 55.75597 25.68116 43.86768 77.60934
[7] 25.47890 NA 67.65848 109.42411 88.61853 85.31571
[13] 87.12714 49.61298 54.39780 98.96013 41.66938 111.04546
[19] 56.01122 92.28620
> colSd(tmp5,na.rm=TRUE)
[1] 134.249519 7.288447 7.466992 5.067658 6.623268 8.809616
[7] 5.047663 NA 8.225478 10.460598 9.413742 9.236651
[13] 9.334192 7.043648 7.375486 9.947871 6.455182 10.537811
[19] 7.484064 9.606571
> colMax(tmp5,na.rm=TRUE)
[1] 472.48217 78.54420 87.28765 71.63994 83.78247 83.18502 81.04520
[8] -Inf 85.75021 89.52249 85.00836 87.23700 81.05534 76.36801
[15] 81.86309 80.97280 83.66055 90.81572 86.66277 88.43770
> colMin(tmp5,na.rm=TRUE)
[1] 61.27545 55.34179 61.64732 57.04556 62.34317 56.59548 66.79796 Inf
[9] 63.03135 58.34896 59.50322 63.40055 53.57564 54.44873 58.26551 56.31152
[17] 63.86677 58.07544 60.41786 62.47322
>
>
>
>
> 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] 296.5652 337.4112 249.4593 215.4573 206.6997 189.7461 272.4622 201.8798
[9] 182.3783 263.0928
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 296.5652 337.4112 249.4593 215.4573 206.6997 189.7461 272.4622 201.8798
[9] 182.3783 263.0928
>
>
>
> 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.131628e-14 0.000000e+00 5.684342e-14 2.842171e-14 0.000000e+00
[6] 2.842171e-13 -1.421085e-14 0.000000e+00 2.842171e-14 -7.105427e-14
[11] 5.684342e-14 -1.136868e-13 -8.526513e-14 2.842171e-13 -8.526513e-14
[16] 0.000000e+00 -1.705303e-13 2.273737e-13 -2.842171e-14 -5.684342e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
7 15
2 5
3 8
2 18
8 6
8 1
8 15
5 10
1 15
9 19
1 9
6 9
5 11
6 14
3 18
10 16
6 1
6 18
4 8
6 5
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.185666
> Min(tmp)
[1] -2.55683
> mean(tmp)
[1] -0.1916976
> Sum(tmp)
[1] -19.16976
> Var(tmp)
[1] 1.190571
>
> rowMeans(tmp)
[1] -0.1916976
> rowSums(tmp)
[1] -19.16976
> rowVars(tmp)
[1] 1.190571
> rowSd(tmp)
[1] 1.091133
> rowMax(tmp)
[1] 2.185666
> rowMin(tmp)
[1] -2.55683
>
> colMeans(tmp)
[1] 0.83380134 1.57261399 1.00915766 2.08658541 -0.71648725 -1.02786132
[7] -0.69584492 0.59648765 1.13383008 0.32782611 0.90771227 -1.16310326
[13] -0.11421613 0.87185844 -0.53246504 0.57485860 -0.55642559 -1.24804800
[19] -0.83036931 1.07671475 -0.67934973 -2.23245780 -2.55683004 -0.73855745
[25] -1.08058202 -0.39310313 -1.55411793 1.25416789 1.24577209 0.96715431
[31] 0.57495991 2.18566631 -0.80936438 -0.39266864 -0.41238154 1.63334189
[37] -0.11223545 -0.14188963 -0.10701423 -0.58689890 -1.89638202 -0.47289629
[43] 0.29568382 1.47898801 -1.50122432 1.52484190 0.82163787 0.16165732
[49] -0.33238104 -1.64267195 -0.94831134 0.75038235 -2.01950657 -0.50730592
[55] 0.29329062 1.60504364 -0.91195039 -2.06101569 -1.37059633 -0.23571613
[61] -1.60183815 -1.10403030 -0.01574614 0.14863993 0.25491684 -2.16397460
[67] 0.27696099 -1.29082400 -2.08181366 -0.38729471 -0.11165225 -1.58024350
[73] 0.03865256 -0.68187111 -0.98654621 1.84996028 -0.05815276 -0.17894206
[79] 0.28951283 -0.94397249 0.71381325 -0.20626217 -0.19921084 0.27820732
[85] -2.41344441 -0.58328369 -0.26903416 -1.54635360 1.17904067 1.26742250
[91] 0.80300628 0.81895189 0.89585124 -0.23058466 -0.32630607 0.96561781
[97] -1.63435054 -1.05300854 -0.58050779 0.07712815
> colSums(tmp)
[1] 0.83380134 1.57261399 1.00915766 2.08658541 -0.71648725 -1.02786132
[7] -0.69584492 0.59648765 1.13383008 0.32782611 0.90771227 -1.16310326
[13] -0.11421613 0.87185844 -0.53246504 0.57485860 -0.55642559 -1.24804800
[19] -0.83036931 1.07671475 -0.67934973 -2.23245780 -2.55683004 -0.73855745
[25] -1.08058202 -0.39310313 -1.55411793 1.25416789 1.24577209 0.96715431
[31] 0.57495991 2.18566631 -0.80936438 -0.39266864 -0.41238154 1.63334189
[37] -0.11223545 -0.14188963 -0.10701423 -0.58689890 -1.89638202 -0.47289629
[43] 0.29568382 1.47898801 -1.50122432 1.52484190 0.82163787 0.16165732
[49] -0.33238104 -1.64267195 -0.94831134 0.75038235 -2.01950657 -0.50730592
[55] 0.29329062 1.60504364 -0.91195039 -2.06101569 -1.37059633 -0.23571613
[61] -1.60183815 -1.10403030 -0.01574614 0.14863993 0.25491684 -2.16397460
[67] 0.27696099 -1.29082400 -2.08181366 -0.38729471 -0.11165225 -1.58024350
[73] 0.03865256 -0.68187111 -0.98654621 1.84996028 -0.05815276 -0.17894206
[79] 0.28951283 -0.94397249 0.71381325 -0.20626217 -0.19921084 0.27820732
[85] -2.41344441 -0.58328369 -0.26903416 -1.54635360 1.17904067 1.26742250
[91] 0.80300628 0.81895189 0.89585124 -0.23058466 -0.32630607 0.96561781
[97] -1.63435054 -1.05300854 -0.58050779 0.07712815
> 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.83380134 1.57261399 1.00915766 2.08658541 -0.71648725 -1.02786132
[7] -0.69584492 0.59648765 1.13383008 0.32782611 0.90771227 -1.16310326
[13] -0.11421613 0.87185844 -0.53246504 0.57485860 -0.55642559 -1.24804800
[19] -0.83036931 1.07671475 -0.67934973 -2.23245780 -2.55683004 -0.73855745
[25] -1.08058202 -0.39310313 -1.55411793 1.25416789 1.24577209 0.96715431
[31] 0.57495991 2.18566631 -0.80936438 -0.39266864 -0.41238154 1.63334189
[37] -0.11223545 -0.14188963 -0.10701423 -0.58689890 -1.89638202 -0.47289629
[43] 0.29568382 1.47898801 -1.50122432 1.52484190 0.82163787 0.16165732
[49] -0.33238104 -1.64267195 -0.94831134 0.75038235 -2.01950657 -0.50730592
[55] 0.29329062 1.60504364 -0.91195039 -2.06101569 -1.37059633 -0.23571613
[61] -1.60183815 -1.10403030 -0.01574614 0.14863993 0.25491684 -2.16397460
[67] 0.27696099 -1.29082400 -2.08181366 -0.38729471 -0.11165225 -1.58024350
[73] 0.03865256 -0.68187111 -0.98654621 1.84996028 -0.05815276 -0.17894206
[79] 0.28951283 -0.94397249 0.71381325 -0.20626217 -0.19921084 0.27820732
[85] -2.41344441 -0.58328369 -0.26903416 -1.54635360 1.17904067 1.26742250
[91] 0.80300628 0.81895189 0.89585124 -0.23058466 -0.32630607 0.96561781
[97] -1.63435054 -1.05300854 -0.58050779 0.07712815
> colMin(tmp)
[1] 0.83380134 1.57261399 1.00915766 2.08658541 -0.71648725 -1.02786132
[7] -0.69584492 0.59648765 1.13383008 0.32782611 0.90771227 -1.16310326
[13] -0.11421613 0.87185844 -0.53246504 0.57485860 -0.55642559 -1.24804800
[19] -0.83036931 1.07671475 -0.67934973 -2.23245780 -2.55683004 -0.73855745
[25] -1.08058202 -0.39310313 -1.55411793 1.25416789 1.24577209 0.96715431
[31] 0.57495991 2.18566631 -0.80936438 -0.39266864 -0.41238154 1.63334189
[37] -0.11223545 -0.14188963 -0.10701423 -0.58689890 -1.89638202 -0.47289629
[43] 0.29568382 1.47898801 -1.50122432 1.52484190 0.82163787 0.16165732
[49] -0.33238104 -1.64267195 -0.94831134 0.75038235 -2.01950657 -0.50730592
[55] 0.29329062 1.60504364 -0.91195039 -2.06101569 -1.37059633 -0.23571613
[61] -1.60183815 -1.10403030 -0.01574614 0.14863993 0.25491684 -2.16397460
[67] 0.27696099 -1.29082400 -2.08181366 -0.38729471 -0.11165225 -1.58024350
[73] 0.03865256 -0.68187111 -0.98654621 1.84996028 -0.05815276 -0.17894206
[79] 0.28951283 -0.94397249 0.71381325 -0.20626217 -0.19921084 0.27820732
[85] -2.41344441 -0.58328369 -0.26903416 -1.54635360 1.17904067 1.26742250
[91] 0.80300628 0.81895189 0.89585124 -0.23058466 -0.32630607 0.96561781
[97] -1.63435054 -1.05300854 -0.58050779 0.07712815
> colMedians(tmp)
[1] 0.83380134 1.57261399 1.00915766 2.08658541 -0.71648725 -1.02786132
[7] -0.69584492 0.59648765 1.13383008 0.32782611 0.90771227 -1.16310326
[13] -0.11421613 0.87185844 -0.53246504 0.57485860 -0.55642559 -1.24804800
[19] -0.83036931 1.07671475 -0.67934973 -2.23245780 -2.55683004 -0.73855745
[25] -1.08058202 -0.39310313 -1.55411793 1.25416789 1.24577209 0.96715431
[31] 0.57495991 2.18566631 -0.80936438 -0.39266864 -0.41238154 1.63334189
[37] -0.11223545 -0.14188963 -0.10701423 -0.58689890 -1.89638202 -0.47289629
[43] 0.29568382 1.47898801 -1.50122432 1.52484190 0.82163787 0.16165732
[49] -0.33238104 -1.64267195 -0.94831134 0.75038235 -2.01950657 -0.50730592
[55] 0.29329062 1.60504364 -0.91195039 -2.06101569 -1.37059633 -0.23571613
[61] -1.60183815 -1.10403030 -0.01574614 0.14863993 0.25491684 -2.16397460
[67] 0.27696099 -1.29082400 -2.08181366 -0.38729471 -0.11165225 -1.58024350
[73] 0.03865256 -0.68187111 -0.98654621 1.84996028 -0.05815276 -0.17894206
[79] 0.28951283 -0.94397249 0.71381325 -0.20626217 -0.19921084 0.27820732
[85] -2.41344441 -0.58328369 -0.26903416 -1.54635360 1.17904067 1.26742250
[91] 0.80300628 0.81895189 0.89585124 -0.23058466 -0.32630607 0.96561781
[97] -1.63435054 -1.05300854 -0.58050779 0.07712815
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.8338013 1.572614 1.009158 2.086585 -0.7164873 -1.027861 -0.6958449
[2,] 0.8338013 1.572614 1.009158 2.086585 -0.7164873 -1.027861 -0.6958449
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.5964876 1.13383 0.3278261 0.9077123 -1.163103 -0.1142161 0.8718584
[2,] 0.5964876 1.13383 0.3278261 0.9077123 -1.163103 -0.1142161 0.8718584
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -0.532465 0.5748586 -0.5564256 -1.248048 -0.8303693 1.076715 -0.6793497
[2,] -0.532465 0.5748586 -0.5564256 -1.248048 -0.8303693 1.076715 -0.6793497
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -2.232458 -2.55683 -0.7385575 -1.080582 -0.3931031 -1.554118 1.254168
[2,] -2.232458 -2.55683 -0.7385575 -1.080582 -0.3931031 -1.554118 1.254168
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 1.245772 0.9671543 0.5749599 2.185666 -0.8093644 -0.3926686 -0.4123815
[2,] 1.245772 0.9671543 0.5749599 2.185666 -0.8093644 -0.3926686 -0.4123815
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 1.633342 -0.1122355 -0.1418896 -0.1070142 -0.5868989 -1.896382 -0.4728963
[2,] 1.633342 -0.1122355 -0.1418896 -0.1070142 -0.5868989 -1.896382 -0.4728963
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.2956838 1.478988 -1.501224 1.524842 0.8216379 0.1616573 -0.332381
[2,] 0.2956838 1.478988 -1.501224 1.524842 0.8216379 0.1616573 -0.332381
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -1.642672 -0.9483113 0.7503823 -2.019507 -0.5073059 0.2932906 1.605044
[2,] -1.642672 -0.9483113 0.7503823 -2.019507 -0.5073059 0.2932906 1.605044
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.9119504 -2.061016 -1.370596 -0.2357161 -1.601838 -1.10403 -0.01574614
[2,] -0.9119504 -2.061016 -1.370596 -0.2357161 -1.601838 -1.10403 -0.01574614
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 0.1486399 0.2549168 -2.163975 0.276961 -1.290824 -2.081814 -0.3872947
[2,] 0.1486399 0.2549168 -2.163975 0.276961 -1.290824 -2.081814 -0.3872947
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -0.1116523 -1.580243 0.03865256 -0.6818711 -0.9865462 1.84996 -0.05815276
[2,] -0.1116523 -1.580243 0.03865256 -0.6818711 -0.9865462 1.84996 -0.05815276
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.1789421 0.2895128 -0.9439725 0.7138133 -0.2062622 -0.1992108 0.2782073
[2,] -0.1789421 0.2895128 -0.9439725 0.7138133 -0.2062622 -0.1992108 0.2782073
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -2.413444 -0.5832837 -0.2690342 -1.546354 1.179041 1.267423 0.8030063
[2,] -2.413444 -0.5832837 -0.2690342 -1.546354 1.179041 1.267423 0.8030063
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 0.8189519 0.8958512 -0.2305847 -0.3263061 0.9656178 -1.634351 -1.053009
[2,] 0.8189519 0.8958512 -0.2305847 -0.3263061 0.9656178 -1.634351 -1.053009
[,99] [,100]
[1,] -0.5805078 0.07712815
[2,] -0.5805078 0.07712815
>
>
> Max(tmp2)
[1] 2.580809
> Min(tmp2)
[1] -2.792013
> mean(tmp2)
[1] 0.1063404
> Sum(tmp2)
[1] 10.63404
> Var(tmp2)
[1] 0.8941944
>
> rowMeans(tmp2)
[1] 0.38659982 -1.20134199 1.45752486 0.62281058 0.19965880 -1.19545134
[7] -1.49504090 0.83652868 -0.57508525 -0.67522161 -0.19267599 1.08882083
[13] 0.27134051 -1.12658714 0.60435730 -0.67227756 1.43356023 -0.31788306
[19] 1.04195322 -0.28378823 -0.63647393 0.31406893 1.03705948 0.33054122
[25] 0.17171616 -1.65491228 0.53755865 -0.48088024 -0.87374664 0.33179522
[31] 0.60981725 0.82829367 -0.62481718 1.34439601 0.99256799 -1.96849616
[37] 1.02294237 1.56351945 0.02647746 -1.20996473 0.74787387 0.84879268
[43] -0.23261200 2.58080855 0.46537072 -0.58235251 0.97989749 0.86610516
[49] 0.63220109 0.21253859 -2.79201331 0.25516224 -0.01093432 1.60503900
[55] 0.09163973 -0.07973397 -1.10743915 0.54579196 0.83999396 0.49775731
[61] 0.52468272 -0.71930654 -0.74681709 0.14175906 -1.08876552 1.66113595
[67] -0.92127668 -0.24153328 0.76847291 -0.40674941 1.36698463 0.63720198
[73] 0.03938149 1.48669352 0.30845575 -0.47863233 -1.49822883 -0.75256214
[79] 2.04131011 -0.22520276 -0.84862135 1.35486386 -0.81536898 1.16729587
[85] 0.10836015 -1.30315760 0.43892337 1.66547466 -0.36238342 -0.10069080
[91] 0.18624097 0.07220506 -0.48191324 0.05543578 -0.77857021 -0.32564242
[97] 0.40994581 0.55192656 -1.05135701 0.56091362
> rowSums(tmp2)
[1] 0.38659982 -1.20134199 1.45752486 0.62281058 0.19965880 -1.19545134
[7] -1.49504090 0.83652868 -0.57508525 -0.67522161 -0.19267599 1.08882083
[13] 0.27134051 -1.12658714 0.60435730 -0.67227756 1.43356023 -0.31788306
[19] 1.04195322 -0.28378823 -0.63647393 0.31406893 1.03705948 0.33054122
[25] 0.17171616 -1.65491228 0.53755865 -0.48088024 -0.87374664 0.33179522
[31] 0.60981725 0.82829367 -0.62481718 1.34439601 0.99256799 -1.96849616
[37] 1.02294237 1.56351945 0.02647746 -1.20996473 0.74787387 0.84879268
[43] -0.23261200 2.58080855 0.46537072 -0.58235251 0.97989749 0.86610516
[49] 0.63220109 0.21253859 -2.79201331 0.25516224 -0.01093432 1.60503900
[55] 0.09163973 -0.07973397 -1.10743915 0.54579196 0.83999396 0.49775731
[61] 0.52468272 -0.71930654 -0.74681709 0.14175906 -1.08876552 1.66113595
[67] -0.92127668 -0.24153328 0.76847291 -0.40674941 1.36698463 0.63720198
[73] 0.03938149 1.48669352 0.30845575 -0.47863233 -1.49822883 -0.75256214
[79] 2.04131011 -0.22520276 -0.84862135 1.35486386 -0.81536898 1.16729587
[85] 0.10836015 -1.30315760 0.43892337 1.66547466 -0.36238342 -0.10069080
[91] 0.18624097 0.07220506 -0.48191324 0.05543578 -0.77857021 -0.32564242
[97] 0.40994581 0.55192656 -1.05135701 0.56091362
> 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.38659982 -1.20134199 1.45752486 0.62281058 0.19965880 -1.19545134
[7] -1.49504090 0.83652868 -0.57508525 -0.67522161 -0.19267599 1.08882083
[13] 0.27134051 -1.12658714 0.60435730 -0.67227756 1.43356023 -0.31788306
[19] 1.04195322 -0.28378823 -0.63647393 0.31406893 1.03705948 0.33054122
[25] 0.17171616 -1.65491228 0.53755865 -0.48088024 -0.87374664 0.33179522
[31] 0.60981725 0.82829367 -0.62481718 1.34439601 0.99256799 -1.96849616
[37] 1.02294237 1.56351945 0.02647746 -1.20996473 0.74787387 0.84879268
[43] -0.23261200 2.58080855 0.46537072 -0.58235251 0.97989749 0.86610516
[49] 0.63220109 0.21253859 -2.79201331 0.25516224 -0.01093432 1.60503900
[55] 0.09163973 -0.07973397 -1.10743915 0.54579196 0.83999396 0.49775731
[61] 0.52468272 -0.71930654 -0.74681709 0.14175906 -1.08876552 1.66113595
[67] -0.92127668 -0.24153328 0.76847291 -0.40674941 1.36698463 0.63720198
[73] 0.03938149 1.48669352 0.30845575 -0.47863233 -1.49822883 -0.75256214
[79] 2.04131011 -0.22520276 -0.84862135 1.35486386 -0.81536898 1.16729587
[85] 0.10836015 -1.30315760 0.43892337 1.66547466 -0.36238342 -0.10069080
[91] 0.18624097 0.07220506 -0.48191324 0.05543578 -0.77857021 -0.32564242
[97] 0.40994581 0.55192656 -1.05135701 0.56091362
> rowMin(tmp2)
[1] 0.38659982 -1.20134199 1.45752486 0.62281058 0.19965880 -1.19545134
[7] -1.49504090 0.83652868 -0.57508525 -0.67522161 -0.19267599 1.08882083
[13] 0.27134051 -1.12658714 0.60435730 -0.67227756 1.43356023 -0.31788306
[19] 1.04195322 -0.28378823 -0.63647393 0.31406893 1.03705948 0.33054122
[25] 0.17171616 -1.65491228 0.53755865 -0.48088024 -0.87374664 0.33179522
[31] 0.60981725 0.82829367 -0.62481718 1.34439601 0.99256799 -1.96849616
[37] 1.02294237 1.56351945 0.02647746 -1.20996473 0.74787387 0.84879268
[43] -0.23261200 2.58080855 0.46537072 -0.58235251 0.97989749 0.86610516
[49] 0.63220109 0.21253859 -2.79201331 0.25516224 -0.01093432 1.60503900
[55] 0.09163973 -0.07973397 -1.10743915 0.54579196 0.83999396 0.49775731
[61] 0.52468272 -0.71930654 -0.74681709 0.14175906 -1.08876552 1.66113595
[67] -0.92127668 -0.24153328 0.76847291 -0.40674941 1.36698463 0.63720198
[73] 0.03938149 1.48669352 0.30845575 -0.47863233 -1.49822883 -0.75256214
[79] 2.04131011 -0.22520276 -0.84862135 1.35486386 -0.81536898 1.16729587
[85] 0.10836015 -1.30315760 0.43892337 1.66547466 -0.36238342 -0.10069080
[91] 0.18624097 0.07220506 -0.48191324 0.05543578 -0.77857021 -0.32564242
[97] 0.40994581 0.55192656 -1.05135701 0.56091362
>
> colMeans(tmp2)
[1] 0.1063404
> colSums(tmp2)
[1] 10.63404
> colVars(tmp2)
[1] 0.8941944
> colSd(tmp2)
[1] 0.9456185
> colMax(tmp2)
[1] 2.580809
> colMin(tmp2)
[1] -2.792013
> colMedians(tmp2)
[1] 0.1789786
> colRanges(tmp2)
[,1]
[1,] -2.792013
[2,] 2.580809
>
> dataset1 <- matrix(dataset1,1,100)
>
> agree.checks(tmp,dataset1)
>
> dataset2 <- matrix(dataset2,100,1)
> agree.checks(tmp2,dataset2)
>
>
> tmp <- createBufferedMatrix(10,10)
>
> tmp[1:10,1:10] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.561409 -3.560845 3.814875 -3.234046 -2.181214 -1.180325 3.132460
[8] 1.497219 -5.783681 3.379810
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.5387028
[2,] -0.7036543
[3,] 0.3909625
[4,] 0.8815810
[5,] 1.9526722
>
> rowApply(tmp,sum)
[1] 0.3223380 -4.4384225 -0.8849509 3.4330461 -0.1580256 -0.7658330
[7] -2.9463317 0.1763823 -1.5358783 4.2433374
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 6 6 10 9 10 7 1 9 4 1
[2,] 3 9 9 5 6 1 3 5 2 2
[3,] 4 8 4 8 8 8 9 4 9 9
[4,] 5 10 5 1 2 4 8 1 3 3
[5,] 8 1 1 3 4 10 2 8 1 8
[6,] 2 7 8 6 9 6 5 2 5 7
[7,] 9 5 6 10 7 9 4 6 8 4
[8,] 10 4 3 4 3 5 6 3 6 10
[9,] 1 2 2 2 1 2 7 7 7 6
[10,] 7 3 7 7 5 3 10 10 10 5
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.24893369 2.70941752 2.30301455 0.93389953 2.01684669 -1.75429046
[7] -0.69146177 -0.57762337 -1.87791535 2.15349354 2.87159050 1.63041623
[13] 1.87858690 -0.72326876 0.07500648 -3.38719869 -1.81803971 -1.48410666
[19] -0.29356581 -4.68916303
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.03949602
[2,] 0.15115642
[3,] 0.50864913
[4,] 0.75654793
[5,] 0.87207623
>
> rowApply(tmp,sum)
[1] -3.912823 4.098814 1.068462 1.691466 -1.421347
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 15 15 11 10
[2,] 7 17 5 18 20
[3,] 4 19 11 19 7
[4,] 2 8 13 14 19
[5,] 20 14 12 7 4
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 0.50864913 -0.4096724 -0.91160725 -1.712665012 2.2026337 -1.3957735
[2,] 0.75654793 1.0572070 2.06103825 0.006168483 0.6233506 -0.7877704
[3,] 0.87207623 -0.9118455 0.01074519 0.634299153 0.5077802 -0.3041910
[4,] 0.15115642 1.2492669 1.43202055 0.752492812 -0.5799220 1.0519337
[5,] -0.03949602 1.7244616 -0.28918218 1.253604093 -0.7369958 -0.3184892
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -0.4286073 -0.3510395 -0.254348867 -0.14578615 0.21413422 1.594174
[2,] -0.9913214 -1.8446654 0.265060157 0.09976351 0.78247452 2.324824
[3,] 1.3803865 1.8092649 0.002042482 -0.46011382 0.99648448 1.609700
[4,] -1.1617520 -0.8865065 0.298702442 1.65979687 0.80280345 -1.632385
[5,] 0.5098325 0.6953232 -2.189371564 0.99983313 0.07569383 -2.265896
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -0.1775683 -0.01232771 -0.8474181 0.32196575 0.6857427 0.188636058
[2,] 1.2035293 0.52497920 0.1664427 -1.14288677 -0.3062060 -0.006449055
[3,] -0.4947452 -1.47223325 1.0350869 -1.11305944 -1.1160982 -2.194210062
[4,] 1.2205217 0.12188998 -0.9593019 -0.09796664 -1.3435787 0.665846826
[5,] 0.1268494 0.11442302 0.6801968 -1.35525158 0.2621005 -0.137930431
[,19] [,20]
[1,] 0.07838938 -3.0603338
[2,] 0.30328186 -0.9965545
[3,] 0.74355632 -0.4664637
[4,] -1.04105780 -0.0124942
[5,] -0.37773558 -0.1533169
>
>
> 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 : 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.22-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 565 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 1.779425 0.009065228 0.2411615 0.1874669 0.5429035 1.043763 0.2465436
col8 col9 col10 col11 col12 col13 col14
row1 -0.05380217 -1.207347 0.3306495 -0.07050194 1.129848 -1.679522 0.5958956
col15 col16 col17 col18 col19 col20
row1 -0.2495646 0.4364292 1.542886 1.119238 -1.27088 0.1533543
> tmp[,"col10"]
col10
row1 0.3306495
row2 1.0057712
row3 0.6356331
row4 -0.4580170
row5 -0.1111312
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 1.7794254 0.009065228 0.24116151 0.1874669 0.54290348 1.0437625
row5 0.6360848 -0.648149794 -0.01603286 -0.4631597 0.05851452 0.1751219
col7 col8 col9 col10 col11 col12
row1 0.2465436 -0.05380217 -1.2073467 0.3306495 -0.07050194 1.1298476
row5 -0.4177236 1.42367204 0.3226432 -0.1111312 -0.35739981 -0.5620184
col13 col14 col15 col16 col17 col18 col19
row1 -1.6795224 0.5958956 -0.2495646 0.4364292 1.5428863 1.1192380 -1.270880
row5 -0.1264472 -1.5018974 -0.6145238 2.2154110 -0.3723246 0.1008092 0.100885
col20
row1 0.1533543
row5 0.3562395
> tmp[,c("col6","col20")]
col6 col20
row1 1.0437625 0.1533543
row2 -1.1959383 0.1822024
row3 0.7050959 -0.2307727
row4 -1.1325954 -1.6002640
row5 0.1751219 0.3562395
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 1.0437625 0.1533543
row5 0.1751219 0.3562395
>
>
>
>
> 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 48.75956 49.0735 49.03234 49.7678 49.13995 104.6652 50.85853 49.58516
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.37492 48.90518 49.82478 52.37013 49.73594 48.86524 49.89879 49.21825
col17 col18 col19 col20
row1 50.4243 50.61809 50.08141 105.0698
> tmp[,"col10"]
col10
row1 48.90518
row2 30.55733
row3 31.45651
row4 31.53400
row5 49.92598
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 48.75956 49.07350 49.03234 49.76780 49.13995 104.6652 50.85853 49.58516
row5 50.61932 46.93368 49.06708 48.76504 49.60475 105.8376 49.97994 50.87197
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.37492 48.90518 49.82478 52.37013 49.73594 48.86524 49.89879 49.21825
row5 48.64535 49.92598 50.99776 51.60682 48.45033 49.58849 50.14455 49.99663
col17 col18 col19 col20
row1 50.4243 50.61809 50.08141 105.0698
row5 48.8411 50.09133 49.04362 106.0936
> tmp[,c("col6","col20")]
col6 col20
row1 104.66521 105.06981
row2 76.27859 75.32979
row3 75.90993 75.56936
row4 75.23526 74.85738
row5 105.83763 106.09364
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.6652 105.0698
row5 105.8376 106.0936
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.6652 105.0698
row5 105.8376 106.0936
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 0.1926033
[2,] 0.2615413
[3,] 1.0328236
[4,] 0.3591325
[5,] -0.6223320
> tmp[,c("col17","col7")]
col17 col7
[1,] 2.2033052 -1.4472579
[2,] -1.8410889 1.9497700
[3,] -0.5244769 0.7998990
[4,] -1.2746423 0.7015651
[5,] 0.4545576 1.4345570
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.2605242 0.3662801
[2,] -1.1264742 0.5340412
[3,] -0.8097570 0.8928786
[4,] 0.7860932 -1.8422582
[5,] -1.4004096 -0.3339581
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.2605242
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.2605242
[2,] -1.1264742
>
>
>
> 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.94866370 0.7861489 0.3739894 -1.6801185 -1.8461825 0.1041888 -0.4875389
row1 0.08656347 0.1460144 0.2909609 0.3870934 0.2085705 -0.8103983 -0.3864361
[,8] [,9] [,10] [,11] [,12] [,13]
row3 -0.6228888 0.005913424 2.1216871 -0.03438641 0.65675576 -0.4474875
row1 0.4210394 -0.454651639 -0.5202484 0.82585746 0.05499152 1.7977763
[,14] [,15] [,16] [,17] [,18] [,19]
row3 -2.3192750 0.8314873 -0.4097013 -0.9065738 0.6464352 0.2782963
row1 0.8310497 -0.1112192 0.4379321 -0.3503602 -1.1156428 -0.3649826
[,20]
row3 1.7176671
row1 0.4059285
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.4561937 2.680985 0.3833446 -0.1445052 -0.3530873 0.9204068 -1.657388
[,8] [,9] [,10]
row2 -0.4132869 -0.8285956 -0.005267562
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 1.368741 1.037819 -0.9405551 -0.5572902 -0.2126467 -1.204033 -0.2136519
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.04551285 0.3351388 -1.276653 -0.2444601 0.3053155 -2.69225 1.247785
[,15] [,16] [,17] [,18] [,19] [,20]
row5 1.343427 -1.723345 -0.0601299 -0.598255 -1.159027 1.735078
>
>
> 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: 0x418a2f10>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca344d2898"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca1a227e5"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca74e7b411"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca7132a619"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca2436aa49"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349ecad961795"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca102413f8"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca37ef2c8"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca37a9f3d3"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca13f2bfc3"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca38d7a210"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca238f9f2c"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca4a87702b"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca5cacb969"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM349eca4e4da234"
>
>
> ### 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: 0x40e57430>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x40e57430>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x40e57430>
> rowMedians(tmp)
[1] -0.215996831 -0.296154720 -0.159430226 -0.335786042 0.210430652
[6] 0.104739696 -0.233610392 0.034390334 -0.112061317 -0.340225138
[11] 0.359469066 -0.059586662 -0.259315221 0.588154408 -0.598973214
[16] -0.551076027 -0.333521248 0.058466301 -0.037354424 0.416714018
[21] 0.127998206 0.142490652 -0.345627297 0.107547536 -0.392966299
[26] 0.344247576 0.147095814 -0.136805134 0.593717457 -0.007301327
[31] 0.001923778 -0.102103510 -0.057079612 -0.027308724 -0.140565138
[36] 0.001475935 -0.055809144 0.282105894 0.157807144 0.533068385
[41] 0.297984837 0.401930126 -0.125040497 -0.063693182 -0.049344026
[46] -0.047598731 0.296969868 -0.233836948 -0.006402521 -0.233242452
[51] -0.127202657 0.512053373 0.616154813 0.284951923 -0.186154455
[56] -0.402896103 0.301244527 0.775817170 0.834844864 0.131664995
[61] -0.032657544 0.343519046 0.132200842 0.016072298 0.594752570
[66] -0.005159682 0.135324217 0.065335500 0.204044784 -0.209529041
[71] 0.268415137 -0.067500000 -0.209978382 0.262662804 0.693143094
[76] -0.286427425 -0.111583968 0.435600915 0.363741874 0.098534460
[81] 0.064586394 0.352755313 -0.084223649 -0.009264035 -0.271718568
[86] 0.186160864 -0.440927938 0.030039610 0.036539369 -0.235199829
[91] 0.079810572 -0.243127841 0.136483574 0.119552729 -0.237830383
[96] 0.255332970 -0.573372851 -0.256367619 0.392120481 0.008920692
[101] 0.735629255 0.292805173 0.059745043 0.280309417 0.510334079
[106] 0.629794155 -0.419835541 0.326426218 -0.037194906 -0.225172580
[111] -0.143568744 -0.154562191 0.092499854 -0.034965219 -0.725033651
[116] 0.096620967 -0.208466502 -0.334155429 0.285526753 0.134289465
[121] 0.317701728 0.277854204 0.052805313 0.222017000 0.166230253
[126] 0.024376896 0.414108669 0.101569393 -0.085469626 0.534405878
[131] -0.049586743 -0.061087349 -0.397464577 -0.107399455 -0.086581081
[136] 0.252595870 0.096132147 0.592594086 0.301029775 -0.075071584
[141] 0.142604294 -0.442702286 -0.272175677 0.029049016 0.382055192
[146] 0.268735427 0.356357617 -0.585218061 -0.230592466 0.352111296
[151] -0.224670259 -0.242111941 0.428937721 0.058746113 0.111634264
[156] 0.640109666 -0.194004092 0.312024219 0.154924104 -0.556024850
[161] -0.499564952 -0.093876294 0.748815376 -0.168166436 0.116423551
[166] 0.130020060 -0.059152574 0.616028075 0.205478985 0.562040900
[171] -0.095586211 -0.081552222 0.435261022 0.302194290 0.145889119
[176] -0.013153225 -0.038349417 0.171800506 -0.406211778 -0.269378228
[181] -0.447787511 -0.274889693 0.150638472 -0.853655264 0.340116519
[186] -0.062170779 0.083503939 -0.104751547 0.310812852 0.191129495
[191] -0.074973594 -0.125956367 0.016059624 -0.166050983 -0.384163203
[196] -0.464939567 0.250263840 -0.469025092 0.344661411 0.055982758
[201] -0.119480395 -0.195034407 0.196599215 0.327529278 0.017956010
[206] 0.143838496 0.174441729 0.122289668 0.077728361 -0.164672250
[211] -0.646593780 -0.208487589 0.340808750 -0.576111785 0.015340960
[216] 0.373524417 0.126271381 -0.349663588 0.385397711 0.160143368
[221] 0.254344624 0.056385533 -0.241330205 0.489756944 0.142679531
[226] 0.574322296 0.211367046 0.156571597 0.109295342 -0.086258452
>
> proc.time()
user system elapsed
1.887 0.938 2.861
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: 0x1cbcbff0>
> .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: 0x1cbcbff0>
> .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: 0x1cbcbff0>
> .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: 0x1cbcbff0>
> 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: 0x1cab10e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1cab10e0>
> .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: 0x1cab10e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1cab10e0>
> .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: 0x1cab10e0>
> 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: 0x1ba38520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1ba38520>
> .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: 0x1ba38520>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1ba38520>
> .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: 0x1ba38520>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x1ba38520>
> .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: 0x1ba38520>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x1ba38520>
> .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: 0x1ba38520>
> 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: 0x1b43c720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x1b43c720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1b43c720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1b43c720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile349f3d2fafb78e" "BufferedMatrixFile349f3d313e6cb3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile349f3d2fafb78e" "BufferedMatrixFile349f3d313e6cb3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x1c32c7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1c32c7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1c32c7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x1c32c7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x1c32c7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x1c32c7d0>
> .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: 0x1c433c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1c433c90>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x1c433c90>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x1c433c90>
> 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: 0x1d6dc110>
> .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: 0x1d6dc110>
> rm(P)
>
> proc.time()
user system elapsed
0.334 0.040 0.358
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.321 0.054 0.359