| Back to Multiple platform build/check report for BioC 3.22: simplified long |
|
This page was generated on 2025-12-08 12:02 -0500 (Mon, 08 Dec 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" | 4879 |
| merida1 | macOS 12.7.6 Monterey | x86_64 | 4.5.2 (2025-10-31) -- "[Not] Part in a Rumble" | 4668 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4669 |
| 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 | |||||||||
| 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-12-05 08:27:34 -0000 (Fri, 05 Dec 2025) |
| EndedAt: 2025-12-05 08:28:04 -0000 (Fri, 05 Dec 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.328 0.044 0.358
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 Dec 5 08:27:58 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 Dec 5 08:27:58 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: 0x2f248ff0>
>
>
>
> 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 Dec 5 08:27:58 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 Dec 5 08:27:58 2025"
>
> ColMode(tmp2)
<pointer: 0x2f248ff0>
>
>
>
> ### 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.9679925 0.7532039 1.9373106 0.2772087
[2,] 1.6429170 0.3481873 -1.2535659 0.9097719
[3,] -0.5501184 -0.5621661 -0.1172352 -1.7855553
[4,] -0.7693004 1.7969745 1.4321958 -1.1864699
> 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.9679925 0.7532039 1.9373106 0.2772087
[2,] 1.6429170 0.3481873 1.2535659 0.9097719
[3,] 0.5501184 0.5621661 0.1172352 1.7855553
[4,] 0.7693004 1.7969745 1.4321958 1.1864699
> 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.0482831 0.8678732 1.3918731 0.5265061
[2,] 1.2817633 0.5900740 1.1196276 0.9538196
[3,] 0.7416997 0.7497774 0.3423962 1.3362467
[4,] 0.8770977 1.3405128 1.1967438 1.0892520
>
> 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,] 226.45082 34.43194 40.85604 30.54227
[2,] 39.46055 31.24893 37.44984 35.44797
[3,] 32.96711 33.05994 28.54120 40.14802
[4,] 34.54028 40.20210 38.39963 37.07899
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x2df2b6c0>
> exp(tmp5)
<pointer: 0x2df2b6c0>
> log(tmp5,2)
<pointer: 0x2df2b6c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 471.3277
> Min(tmp5)
[1] 52.91604
> mean(tmp5)
[1] 73.84955
> Sum(tmp5)
[1] 14769.91
> Var(tmp5)
[1] 876.3049
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 90.77636 69.36010 69.24516 75.32421 73.97317 72.99735 72.25726 73.34617
[9] 69.30905 71.90664
> rowSums(tmp5)
[1] 1815.527 1387.202 1384.903 1506.484 1479.463 1459.947 1445.145 1466.923
[9] 1386.181 1438.133
> rowVars(tmp5)
[1] 8085.14970 45.99185 53.63755 123.57135 70.48826 50.46896
[7] 80.94911 106.74361 108.25768 76.07376
> rowSd(tmp5)
[1] 89.917460 6.781729 7.323766 11.116265 8.395729 7.104151 8.997173
[8] 10.331680 10.404695 8.722028
> rowMax(tmp5)
[1] 471.32772 82.13196 83.56285 91.87155 93.96729 84.63172 87.65984
[8] 92.08678 88.77868 88.81353
> rowMin(tmp5)
[1] 57.80480 57.60046 54.57378 56.61643 59.84387 62.43485 58.40453 57.15010
[9] 54.51378 52.91604
>
> colMeans(tmp5)
[1] 109.62818 71.92479 71.19959 73.58080 70.07260 68.63590 69.86913
[8] 70.65122 74.68676 71.95097 69.34414 75.67125 71.03214 72.71198
[15] 68.49983 69.62634 75.65260 74.42369 74.94291 72.88616
> colSums(tmp5)
[1] 1096.2818 719.2479 711.9959 735.8080 700.7260 686.3590 698.6913
[8] 706.5122 746.8676 719.5097 693.4414 756.7125 710.3214 727.1198
[15] 684.9983 696.2634 756.5260 744.2369 749.4291 728.8616
> colVars(tmp5)
[1] 16222.51635 47.35200 91.88510 68.87971 55.23016 108.71489
[7] 92.19674 93.16838 89.22621 69.30179 71.95439 65.56320
[13] 132.25707 132.65355 23.80083 52.66767 81.24927 81.76648
[19] 124.75010 62.33668
> colSd(tmp5)
[1] 127.367642 6.881279 9.585672 8.299380 7.431700 10.426643
[7] 9.601913 9.652377 9.445962 8.324770 8.482594 8.097111
[13] 11.500307 11.517532 4.878609 7.257249 9.013838 9.042482
[19] 11.169158 7.895358
> colMax(tmp5)
[1] 471.32772 83.67541 85.03650 84.50992 84.63172 87.82725 85.21264
[8] 88.77868 93.96729 83.72702 79.03629 91.87155 87.65984 87.73818
[15] 74.75875 83.58668 90.96325 88.81353 92.08678 86.70673
> colMin(tmp5)
[1] 53.80981 61.06856 57.51697 58.20952 60.37585 58.42362 52.91604 56.61643
[9] 61.00440 58.40453 57.15010 64.14288 54.51378 54.57378 60.61005 59.84387
[17] 64.66808 59.15251 57.60046 60.80285
>
>
> ### 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] 90.77636 69.36010 69.24516 75.32421 NA 72.99735 72.25726 73.34617
[9] 69.30905 71.90664
> rowSums(tmp5)
[1] 1815.527 1387.202 1384.903 1506.484 NA 1459.947 1445.145 1466.923
[9] 1386.181 1438.133
> rowVars(tmp5)
[1] 8085.14970 45.99185 53.63755 123.57135 68.86014 50.46896
[7] 80.94911 106.74361 108.25768 76.07376
> rowSd(tmp5)
[1] 89.917460 6.781729 7.323766 11.116265 8.298201 7.104151 8.997173
[8] 10.331680 10.404695 8.722028
> rowMax(tmp5)
[1] 471.32772 82.13196 83.56285 91.87155 NA 84.63172 87.65984
[8] 92.08678 88.77868 88.81353
> rowMin(tmp5)
[1] 57.80480 57.60046 54.57378 56.61643 NA 62.43485 58.40453 57.15010
[9] 54.51378 52.91604
>
> colMeans(tmp5)
[1] 109.62818 71.92479 71.19959 73.58080 70.07260 68.63590 69.86913
[8] 70.65122 74.68676 71.95097 69.34414 75.67125 71.03214 72.71198
[15] 68.49983 69.62634 75.65260 NA 74.94291 72.88616
> colSums(tmp5)
[1] 1096.2818 719.2479 711.9959 735.8080 700.7260 686.3590 698.6913
[8] 706.5122 746.8676 719.5097 693.4414 756.7125 710.3214 727.1198
[15] 684.9983 696.2634 756.5260 NA 749.4291 728.8616
> colVars(tmp5)
[1] 16222.51635 47.35200 91.88510 68.87971 55.23016 108.71489
[7] 92.19674 93.16838 89.22621 69.30179 71.95439 65.56320
[13] 132.25707 132.65355 23.80083 52.66767 81.24927 NA
[19] 124.75010 62.33668
> colSd(tmp5)
[1] 127.367642 6.881279 9.585672 8.299380 7.431700 10.426643
[7] 9.601913 9.652377 9.445962 8.324770 8.482594 8.097111
[13] 11.500307 11.517532 4.878609 7.257249 9.013838 NA
[19] 11.169158 7.895358
> colMax(tmp5)
[1] 471.32772 83.67541 85.03650 84.50992 84.63172 87.82725 85.21264
[8] 88.77868 93.96729 83.72702 79.03629 91.87155 87.65984 87.73818
[15] 74.75875 83.58668 90.96325 NA 92.08678 86.70673
> colMin(tmp5)
[1] 53.80981 61.06856 57.51697 58.20952 60.37585 58.42362 52.91604 56.61643
[9] 61.00440 58.40453 57.15010 64.14288 54.51378 54.57378 60.61005 59.84387
[17] 64.66808 NA 57.60046 60.80285
>
> Max(tmp5,na.rm=TRUE)
[1] 471.3277
> Min(tmp5,na.rm=TRUE)
[1] 52.91604
> mean(tmp5,na.rm=TRUE)
[1] 73.8
> Sum(tmp5,na.rm=TRUE)
[1] 14686.2
> Var(tmp5,na.rm=TRUE)
[1] 880.2372
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77636 69.36010 69.24516 75.32421 73.46071 72.99735 72.25726 73.34617
[9] 69.30905 71.90664
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.527 1387.202 1384.903 1506.484 1395.754 1459.947 1445.145 1466.923
[9] 1386.181 1438.133
> rowVars(tmp5,na.rm=TRUE)
[1] 8085.14970 45.99185 53.63755 123.57135 68.86014 50.46896
[7] 80.94911 106.74361 108.25768 76.07376
> rowSd(tmp5,na.rm=TRUE)
[1] 89.917460 6.781729 7.323766 11.116265 8.298201 7.104151 8.997173
[8] 10.331680 10.404695 8.722028
> rowMax(tmp5,na.rm=TRUE)
[1] 471.32772 82.13196 83.56285 91.87155 93.96729 84.63172 87.65984
[8] 92.08678 88.77868 88.81353
> rowMin(tmp5,na.rm=TRUE)
[1] 57.80480 57.60046 54.57378 56.61643 59.84387 62.43485 58.40453 57.15010
[9] 54.51378 52.91604
>
> colMeans(tmp5,na.rm=TRUE)
[1] 109.62818 71.92479 71.19959 73.58080 70.07260 68.63590 69.86913
[8] 70.65122 74.68676 71.95097 69.34414 75.67125 71.03214 72.71198
[15] 68.49983 69.62634 75.65260 73.39189 74.94291 72.88616
> colSums(tmp5,na.rm=TRUE)
[1] 1096.2818 719.2479 711.9959 735.8080 700.7260 686.3590 698.6913
[8] 706.5122 746.8676 719.5097 693.4414 756.7125 710.3214 727.1198
[15] 684.9983 696.2634 756.5260 660.5270 749.4291 728.8616
> colVars(tmp5,na.rm=TRUE)
[1] 16222.51635 47.35200 91.88510 68.87971 55.23016 108.71489
[7] 92.19674 93.16838 89.22621 69.30179 71.95439 65.56320
[13] 132.25707 132.65355 23.80083 52.66767 81.24927 80.01029
[19] 124.75010 62.33668
> colSd(tmp5,na.rm=TRUE)
[1] 127.367642 6.881279 9.585672 8.299380 7.431700 10.426643
[7] 9.601913 9.652377 9.445962 8.324770 8.482594 8.097111
[13] 11.500307 11.517532 4.878609 7.257249 9.013838 8.944847
[19] 11.169158 7.895358
> colMax(tmp5,na.rm=TRUE)
[1] 471.32772 83.67541 85.03650 84.50992 84.63172 87.82725 85.21264
[8] 88.77868 93.96729 83.72702 79.03629 91.87155 87.65984 87.73818
[15] 74.75875 83.58668 90.96325 88.81353 92.08678 86.70673
> colMin(tmp5,na.rm=TRUE)
[1] 53.80981 61.06856 57.51697 58.20952 60.37585 58.42362 52.91604 56.61643
[9] 61.00440 58.40453 57.15010 64.14288 54.51378 54.57378 60.61005 59.84387
[17] 64.66808 59.15251 57.60046 60.80285
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 90.77636 69.36010 69.24516 75.32421 NaN 72.99735 72.25726 73.34617
[9] 69.30905 71.90664
> rowSums(tmp5,na.rm=TRUE)
[1] 1815.527 1387.202 1384.903 1506.484 0.000 1459.947 1445.145 1466.923
[9] 1386.181 1438.133
> rowVars(tmp5,na.rm=TRUE)
[1] 8085.14970 45.99185 53.63755 123.57135 NA 50.46896
[7] 80.94911 106.74361 108.25768 76.07376
> rowSd(tmp5,na.rm=TRUE)
[1] 89.917460 6.781729 7.323766 11.116265 NA 7.104151 8.997173
[8] 10.331680 10.404695 8.722028
> rowMax(tmp5,na.rm=TRUE)
[1] 471.32772 82.13196 83.56285 91.87155 NA 84.63172 87.65984
[8] 92.08678 88.77868 88.81353
> rowMin(tmp5,na.rm=TRUE)
[1] 57.80480 57.60046 54.57378 56.61643 NA 62.43485 58.40453 57.15010
[9] 54.51378 52.91604
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 113.54492 71.54223 71.11250 73.98085 70.13307 67.32074 68.16430
[8] 70.81958 72.54447 72.60538 70.26996 75.34564 71.52684 71.72185
[15] 67.83765 70.71328 76.04667 NaN 74.69748 73.39696
> colSums(tmp5,na.rm=TRUE)
[1] 1021.9043 643.8800 640.0125 665.8277 631.1976 605.8867 613.4787
[8] 637.3762 652.9003 653.4484 632.4296 678.1107 643.7415 645.4966
[15] 610.5389 636.4195 684.4200 0.0000 672.2773 660.5726
> colVars(tmp5,na.rm=TRUE)
[1] 18077.74575 51.62451 103.28541 75.68918 62.09280 102.84570
[7] 71.02366 104.49556 48.74906 73.14672 71.30586 72.56584
[13] 146.03601 138.20610 21.84308 45.95991 89.65836 NA
[19] 139.66620 67.19347
> colSd(tmp5,na.rm=TRUE)
[1] 134.453508 7.185020 10.162943 8.699953 7.879898 10.141287
[7] 8.427554 10.222307 6.982053 8.552586 8.444280 8.518558
[13] 12.084536 11.756109 4.673658 6.779374 9.468810 NA
[19] 11.818046 8.197163
> colMax(tmp5,na.rm=TRUE)
[1] 471.32772 83.67541 85.03650 84.50992 84.63172 87.82725 82.25555
[8] 88.77868 87.29664 83.72702 79.03629 91.87155 87.65984 87.73818
[15] 74.75875 83.58668 90.96325 -Inf 92.08678 86.70673
> colMin(tmp5,na.rm=TRUE)
[1] 53.80981 61.06856 57.51697 58.20952 60.37585 58.42362 52.91604 56.61643
[9] 61.00440 58.40453 57.15010 64.14288 54.51378 54.57378 60.61005 61.82355
[17] 64.66808 Inf 57.60046 60.80285
>
>
>
>
> 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] 225.6160 144.4523 455.9749 217.9044 319.5873 206.1344 223.5551 148.6945
[9] 278.9105 148.1858
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 225.6160 144.4523 455.9749 217.9044 319.5873 206.1344 223.5551 148.6945
[9] 278.9105 148.1858
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -2.842171e-14 -5.684342e-14 0.000000e+00 1.705303e-13 -8.526513e-14
[6] -8.526513e-14 -1.705303e-13 7.105427e-14 -1.421085e-14 0.000000e+00
[11] 2.842171e-14 1.136868e-13 -1.136868e-13 5.684342e-14 -5.684342e-14
[16] 5.684342e-14 2.842171e-14 5.684342e-14 0.000000e+00 0.000000e+00
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
10 2
7 7
7 6
1 13
5 12
8 19
8 13
10 16
1 17
6 10
9 10
1 18
4 12
2 5
5 15
9 8
8 18
10 1
9 9
1 4
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.338022
> Min(tmp)
[1] -2.798964
> mean(tmp)
[1] -0.08634701
> Sum(tmp)
[1] -8.634701
> Var(tmp)
[1] 1.223492
>
> rowMeans(tmp)
[1] -0.08634701
> rowSums(tmp)
[1] -8.634701
> rowVars(tmp)
[1] 1.223492
> rowSd(tmp)
[1] 1.106116
> rowMax(tmp)
[1] 2.338022
> rowMin(tmp)
[1] -2.798964
>
> colMeans(tmp)
[1] -0.43375908 0.59542826 0.58309594 -2.42855617 -1.79327524 -0.64098495
[7] -0.68881142 1.15508398 -0.56523826 -1.65233620 -0.32444056 -0.03434619
[13] -2.04793463 1.60598323 2.33802248 2.13286865 -0.53529826 1.03780070
[19] 0.64252548 0.52266232 -0.49506662 -0.97814426 -1.62089929 0.08547022
[25] 0.48784169 0.95473462 -0.48674655 0.53982016 0.87920022 1.53971808
[31] 1.23530213 0.01385199 0.51149523 -0.27489862 0.42628132 0.26280786
[37] 0.41664779 -2.79896430 0.99605695 0.31224489 -2.18023830 0.24315049
[43] 0.94777391 -0.42390382 -1.34314894 0.93976641 0.49734587 -0.02715101
[49] 1.58623011 -2.13460089 -0.02134011 1.19399413 1.74257211 -0.18536456
[55] 1.29820956 -0.90569263 0.39237879 0.78037276 -1.66801051 -1.92996469
[61] 0.32629241 -1.68118507 1.04959300 -1.25908622 -1.29716606 -0.77466675
[67] -0.52671252 0.29737805 -1.36643130 -0.84199147 0.65277145 1.45937894
[73] 1.98241905 -0.41534785 -0.76165776 0.48909028 -0.74441022 -1.10512692
[79] 0.38967931 1.06882309 -0.64923711 -0.67216202 0.08777313 -0.22195006
[85] -1.64307552 0.58500639 0.32245906 0.04792873 -0.67076357 -0.64956280
[91] -1.33233608 -0.99904784 -0.72878424 -0.06583551 -0.16197491 1.96376738
[97] -0.36960250 0.99463722 0.02922726 -1.72043391
> colSums(tmp)
[1] -0.43375908 0.59542826 0.58309594 -2.42855617 -1.79327524 -0.64098495
[7] -0.68881142 1.15508398 -0.56523826 -1.65233620 -0.32444056 -0.03434619
[13] -2.04793463 1.60598323 2.33802248 2.13286865 -0.53529826 1.03780070
[19] 0.64252548 0.52266232 -0.49506662 -0.97814426 -1.62089929 0.08547022
[25] 0.48784169 0.95473462 -0.48674655 0.53982016 0.87920022 1.53971808
[31] 1.23530213 0.01385199 0.51149523 -0.27489862 0.42628132 0.26280786
[37] 0.41664779 -2.79896430 0.99605695 0.31224489 -2.18023830 0.24315049
[43] 0.94777391 -0.42390382 -1.34314894 0.93976641 0.49734587 -0.02715101
[49] 1.58623011 -2.13460089 -0.02134011 1.19399413 1.74257211 -0.18536456
[55] 1.29820956 -0.90569263 0.39237879 0.78037276 -1.66801051 -1.92996469
[61] 0.32629241 -1.68118507 1.04959300 -1.25908622 -1.29716606 -0.77466675
[67] -0.52671252 0.29737805 -1.36643130 -0.84199147 0.65277145 1.45937894
[73] 1.98241905 -0.41534785 -0.76165776 0.48909028 -0.74441022 -1.10512692
[79] 0.38967931 1.06882309 -0.64923711 -0.67216202 0.08777313 -0.22195006
[85] -1.64307552 0.58500639 0.32245906 0.04792873 -0.67076357 -0.64956280
[91] -1.33233608 -0.99904784 -0.72878424 -0.06583551 -0.16197491 1.96376738
[97] -0.36960250 0.99463722 0.02922726 -1.72043391
> 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.43375908 0.59542826 0.58309594 -2.42855617 -1.79327524 -0.64098495
[7] -0.68881142 1.15508398 -0.56523826 -1.65233620 -0.32444056 -0.03434619
[13] -2.04793463 1.60598323 2.33802248 2.13286865 -0.53529826 1.03780070
[19] 0.64252548 0.52266232 -0.49506662 -0.97814426 -1.62089929 0.08547022
[25] 0.48784169 0.95473462 -0.48674655 0.53982016 0.87920022 1.53971808
[31] 1.23530213 0.01385199 0.51149523 -0.27489862 0.42628132 0.26280786
[37] 0.41664779 -2.79896430 0.99605695 0.31224489 -2.18023830 0.24315049
[43] 0.94777391 -0.42390382 -1.34314894 0.93976641 0.49734587 -0.02715101
[49] 1.58623011 -2.13460089 -0.02134011 1.19399413 1.74257211 -0.18536456
[55] 1.29820956 -0.90569263 0.39237879 0.78037276 -1.66801051 -1.92996469
[61] 0.32629241 -1.68118507 1.04959300 -1.25908622 -1.29716606 -0.77466675
[67] -0.52671252 0.29737805 -1.36643130 -0.84199147 0.65277145 1.45937894
[73] 1.98241905 -0.41534785 -0.76165776 0.48909028 -0.74441022 -1.10512692
[79] 0.38967931 1.06882309 -0.64923711 -0.67216202 0.08777313 -0.22195006
[85] -1.64307552 0.58500639 0.32245906 0.04792873 -0.67076357 -0.64956280
[91] -1.33233608 -0.99904784 -0.72878424 -0.06583551 -0.16197491 1.96376738
[97] -0.36960250 0.99463722 0.02922726 -1.72043391
> colMin(tmp)
[1] -0.43375908 0.59542826 0.58309594 -2.42855617 -1.79327524 -0.64098495
[7] -0.68881142 1.15508398 -0.56523826 -1.65233620 -0.32444056 -0.03434619
[13] -2.04793463 1.60598323 2.33802248 2.13286865 -0.53529826 1.03780070
[19] 0.64252548 0.52266232 -0.49506662 -0.97814426 -1.62089929 0.08547022
[25] 0.48784169 0.95473462 -0.48674655 0.53982016 0.87920022 1.53971808
[31] 1.23530213 0.01385199 0.51149523 -0.27489862 0.42628132 0.26280786
[37] 0.41664779 -2.79896430 0.99605695 0.31224489 -2.18023830 0.24315049
[43] 0.94777391 -0.42390382 -1.34314894 0.93976641 0.49734587 -0.02715101
[49] 1.58623011 -2.13460089 -0.02134011 1.19399413 1.74257211 -0.18536456
[55] 1.29820956 -0.90569263 0.39237879 0.78037276 -1.66801051 -1.92996469
[61] 0.32629241 -1.68118507 1.04959300 -1.25908622 -1.29716606 -0.77466675
[67] -0.52671252 0.29737805 -1.36643130 -0.84199147 0.65277145 1.45937894
[73] 1.98241905 -0.41534785 -0.76165776 0.48909028 -0.74441022 -1.10512692
[79] 0.38967931 1.06882309 -0.64923711 -0.67216202 0.08777313 -0.22195006
[85] -1.64307552 0.58500639 0.32245906 0.04792873 -0.67076357 -0.64956280
[91] -1.33233608 -0.99904784 -0.72878424 -0.06583551 -0.16197491 1.96376738
[97] -0.36960250 0.99463722 0.02922726 -1.72043391
> colMedians(tmp)
[1] -0.43375908 0.59542826 0.58309594 -2.42855617 -1.79327524 -0.64098495
[7] -0.68881142 1.15508398 -0.56523826 -1.65233620 -0.32444056 -0.03434619
[13] -2.04793463 1.60598323 2.33802248 2.13286865 -0.53529826 1.03780070
[19] 0.64252548 0.52266232 -0.49506662 -0.97814426 -1.62089929 0.08547022
[25] 0.48784169 0.95473462 -0.48674655 0.53982016 0.87920022 1.53971808
[31] 1.23530213 0.01385199 0.51149523 -0.27489862 0.42628132 0.26280786
[37] 0.41664779 -2.79896430 0.99605695 0.31224489 -2.18023830 0.24315049
[43] 0.94777391 -0.42390382 -1.34314894 0.93976641 0.49734587 -0.02715101
[49] 1.58623011 -2.13460089 -0.02134011 1.19399413 1.74257211 -0.18536456
[55] 1.29820956 -0.90569263 0.39237879 0.78037276 -1.66801051 -1.92996469
[61] 0.32629241 -1.68118507 1.04959300 -1.25908622 -1.29716606 -0.77466675
[67] -0.52671252 0.29737805 -1.36643130 -0.84199147 0.65277145 1.45937894
[73] 1.98241905 -0.41534785 -0.76165776 0.48909028 -0.74441022 -1.10512692
[79] 0.38967931 1.06882309 -0.64923711 -0.67216202 0.08777313 -0.22195006
[85] -1.64307552 0.58500639 0.32245906 0.04792873 -0.67076357 -0.64956280
[91] -1.33233608 -0.99904784 -0.72878424 -0.06583551 -0.16197491 1.96376738
[97] -0.36960250 0.99463722 0.02922726 -1.72043391
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.4337591 0.5954283 0.5830959 -2.428556 -1.793275 -0.640985 -0.6888114
[2,] -0.4337591 0.5954283 0.5830959 -2.428556 -1.793275 -0.640985 -0.6888114
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 1.155084 -0.5652383 -1.652336 -0.3244406 -0.03434619 -2.047935 1.605983
[2,] 1.155084 -0.5652383 -1.652336 -0.3244406 -0.03434619 -2.047935 1.605983
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 2.338022 2.132869 -0.5352983 1.037801 0.6425255 0.5226623 -0.4950666
[2,] 2.338022 2.132869 -0.5352983 1.037801 0.6425255 0.5226623 -0.4950666
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] -0.9781443 -1.620899 0.08547022 0.4878417 0.9547346 -0.4867465 0.5398202
[2,] -0.9781443 -1.620899 0.08547022 0.4878417 0.9547346 -0.4867465 0.5398202
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.8792002 1.539718 1.235302 0.01385199 0.5114952 -0.2748986 0.4262813
[2,] 0.8792002 1.539718 1.235302 0.01385199 0.5114952 -0.2748986 0.4262813
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.2628079 0.4166478 -2.798964 0.996057 0.3122449 -2.180238 0.2431505
[2,] 0.2628079 0.4166478 -2.798964 0.996057 0.3122449 -2.180238 0.2431505
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] 0.9477739 -0.4239038 -1.343149 0.9397664 0.4973459 -0.02715101 1.58623
[2,] 0.9477739 -0.4239038 -1.343149 0.9397664 0.4973459 -0.02715101 1.58623
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -2.134601 -0.02134011 1.193994 1.742572 -0.1853646 1.29821 -0.9056926
[2,] -2.134601 -0.02134011 1.193994 1.742572 -0.1853646 1.29821 -0.9056926
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.3923788 0.7803728 -1.668011 -1.929965 0.3262924 -1.681185 1.049593
[2,] 0.3923788 0.7803728 -1.668011 -1.929965 0.3262924 -1.681185 1.049593
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -1.259086 -1.297166 -0.7746667 -0.5267125 0.2973781 -1.366431 -0.8419915
[2,] -1.259086 -1.297166 -0.7746667 -0.5267125 0.2973781 -1.366431 -0.8419915
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.6527715 1.459379 1.982419 -0.4153479 -0.7616578 0.4890903 -0.7444102
[2,] 0.6527715 1.459379 1.982419 -0.4153479 -0.7616578 0.4890903 -0.7444102
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.105127 0.3896793 1.068823 -0.6492371 -0.672162 0.08777313 -0.2219501
[2,] -1.105127 0.3896793 1.068823 -0.6492371 -0.672162 0.08777313 -0.2219501
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.643076 0.5850064 0.3224591 0.04792873 -0.6707636 -0.6495628 -1.332336
[2,] -1.643076 0.5850064 0.3224591 0.04792873 -0.6707636 -0.6495628 -1.332336
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.9990478 -0.7287842 -0.06583551 -0.1619749 1.963767 -0.3696025 0.9946372
[2,] -0.9990478 -0.7287842 -0.06583551 -0.1619749 1.963767 -0.3696025 0.9946372
[,99] [,100]
[1,] 0.02922726 -1.720434
[2,] 0.02922726 -1.720434
>
>
> Max(tmp2)
[1] 1.879009
> Min(tmp2)
[1] -2.706091
> mean(tmp2)
[1] 0.0005813468
> Sum(tmp2)
[1] 0.05813468
> Var(tmp2)
[1] 0.984017
>
> rowMeans(tmp2)
[1] 0.319367586 -0.000612556 0.721519958 0.735721389 -0.769383977
[6] -0.687058847 -0.159918342 0.904900666 0.316048273 0.198906457
[11] 1.022712781 0.388765503 -0.120040305 -2.252043264 0.121920865
[16] -1.372744932 -0.268597341 -0.241469632 0.250786634 -0.037568367
[21] 0.710820072 -0.688135794 1.596434701 -0.059635477 -0.448715448
[26] -1.056338412 -0.419117911 0.668876634 -2.060774825 0.584240935
[31] -0.313304618 -0.563201660 0.676840643 0.943038797 -0.075610160
[36] 1.652729472 0.587519683 -1.981538566 -0.187217698 0.960878246
[41] 0.725406819 -1.211316645 -0.212405845 0.719541819 0.246044675
[46] 0.355237499 0.713105900 -1.695232391 -0.058818385 1.541659686
[51] 0.338217330 0.154128535 -0.022506967 -0.086625146 -0.619744957
[56] 1.005436846 0.902658868 0.227660959 1.667230891 0.412886950
[61] -1.498805392 -1.811032545 -0.953824177 1.213664407 -2.576491471
[66] 0.073258598 -0.847171673 0.381144476 1.541529896 -0.671085912
[71] 0.118839596 1.820635097 -0.400571229 0.167576553 0.777275481
[76] -1.550664045 -0.947965443 -0.355956527 -2.706091359 0.904992247
[81] -0.193679738 1.278654029 0.319349752 1.136303597 -1.662440417
[86] 0.044131967 1.705847508 -0.249770882 0.127889096 -0.500417728
[91] -0.326916164 -0.859785826 0.689437708 0.480195764 0.482626265
[96] -0.302039173 0.941896089 1.879008581 -1.473370489 -0.839609440
> rowSums(tmp2)
[1] 0.319367586 -0.000612556 0.721519958 0.735721389 -0.769383977
[6] -0.687058847 -0.159918342 0.904900666 0.316048273 0.198906457
[11] 1.022712781 0.388765503 -0.120040305 -2.252043264 0.121920865
[16] -1.372744932 -0.268597341 -0.241469632 0.250786634 -0.037568367
[21] 0.710820072 -0.688135794 1.596434701 -0.059635477 -0.448715448
[26] -1.056338412 -0.419117911 0.668876634 -2.060774825 0.584240935
[31] -0.313304618 -0.563201660 0.676840643 0.943038797 -0.075610160
[36] 1.652729472 0.587519683 -1.981538566 -0.187217698 0.960878246
[41] 0.725406819 -1.211316645 -0.212405845 0.719541819 0.246044675
[46] 0.355237499 0.713105900 -1.695232391 -0.058818385 1.541659686
[51] 0.338217330 0.154128535 -0.022506967 -0.086625146 -0.619744957
[56] 1.005436846 0.902658868 0.227660959 1.667230891 0.412886950
[61] -1.498805392 -1.811032545 -0.953824177 1.213664407 -2.576491471
[66] 0.073258598 -0.847171673 0.381144476 1.541529896 -0.671085912
[71] 0.118839596 1.820635097 -0.400571229 0.167576553 0.777275481
[76] -1.550664045 -0.947965443 -0.355956527 -2.706091359 0.904992247
[81] -0.193679738 1.278654029 0.319349752 1.136303597 -1.662440417
[86] 0.044131967 1.705847508 -0.249770882 0.127889096 -0.500417728
[91] -0.326916164 -0.859785826 0.689437708 0.480195764 0.482626265
[96] -0.302039173 0.941896089 1.879008581 -1.473370489 -0.839609440
> 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.319367586 -0.000612556 0.721519958 0.735721389 -0.769383977
[6] -0.687058847 -0.159918342 0.904900666 0.316048273 0.198906457
[11] 1.022712781 0.388765503 -0.120040305 -2.252043264 0.121920865
[16] -1.372744932 -0.268597341 -0.241469632 0.250786634 -0.037568367
[21] 0.710820072 -0.688135794 1.596434701 -0.059635477 -0.448715448
[26] -1.056338412 -0.419117911 0.668876634 -2.060774825 0.584240935
[31] -0.313304618 -0.563201660 0.676840643 0.943038797 -0.075610160
[36] 1.652729472 0.587519683 -1.981538566 -0.187217698 0.960878246
[41] 0.725406819 -1.211316645 -0.212405845 0.719541819 0.246044675
[46] 0.355237499 0.713105900 -1.695232391 -0.058818385 1.541659686
[51] 0.338217330 0.154128535 -0.022506967 -0.086625146 -0.619744957
[56] 1.005436846 0.902658868 0.227660959 1.667230891 0.412886950
[61] -1.498805392 -1.811032545 -0.953824177 1.213664407 -2.576491471
[66] 0.073258598 -0.847171673 0.381144476 1.541529896 -0.671085912
[71] 0.118839596 1.820635097 -0.400571229 0.167576553 0.777275481
[76] -1.550664045 -0.947965443 -0.355956527 -2.706091359 0.904992247
[81] -0.193679738 1.278654029 0.319349752 1.136303597 -1.662440417
[86] 0.044131967 1.705847508 -0.249770882 0.127889096 -0.500417728
[91] -0.326916164 -0.859785826 0.689437708 0.480195764 0.482626265
[96] -0.302039173 0.941896089 1.879008581 -1.473370489 -0.839609440
> rowMin(tmp2)
[1] 0.319367586 -0.000612556 0.721519958 0.735721389 -0.769383977
[6] -0.687058847 -0.159918342 0.904900666 0.316048273 0.198906457
[11] 1.022712781 0.388765503 -0.120040305 -2.252043264 0.121920865
[16] -1.372744932 -0.268597341 -0.241469632 0.250786634 -0.037568367
[21] 0.710820072 -0.688135794 1.596434701 -0.059635477 -0.448715448
[26] -1.056338412 -0.419117911 0.668876634 -2.060774825 0.584240935
[31] -0.313304618 -0.563201660 0.676840643 0.943038797 -0.075610160
[36] 1.652729472 0.587519683 -1.981538566 -0.187217698 0.960878246
[41] 0.725406819 -1.211316645 -0.212405845 0.719541819 0.246044675
[46] 0.355237499 0.713105900 -1.695232391 -0.058818385 1.541659686
[51] 0.338217330 0.154128535 -0.022506967 -0.086625146 -0.619744957
[56] 1.005436846 0.902658868 0.227660959 1.667230891 0.412886950
[61] -1.498805392 -1.811032545 -0.953824177 1.213664407 -2.576491471
[66] 0.073258598 -0.847171673 0.381144476 1.541529896 -0.671085912
[71] 0.118839596 1.820635097 -0.400571229 0.167576553 0.777275481
[76] -1.550664045 -0.947965443 -0.355956527 -2.706091359 0.904992247
[81] -0.193679738 1.278654029 0.319349752 1.136303597 -1.662440417
[86] 0.044131967 1.705847508 -0.249770882 0.127889096 -0.500417728
[91] -0.326916164 -0.859785826 0.689437708 0.480195764 0.482626265
[96] -0.302039173 0.941896089 1.879008581 -1.473370489 -0.839609440
>
> colMeans(tmp2)
[1] 0.0005813468
> colSums(tmp2)
[1] 0.05813468
> colVars(tmp2)
[1] 0.984017
> colSd(tmp2)
[1] 0.9919763
> colMax(tmp2)
[1] 1.879009
> colMin(tmp2)
[1] -2.706091
> colMedians(tmp2)
[1] 0.0960491
> colRanges(tmp2)
[,1]
[1,] -2.706091
[2,] 1.879009
>
> 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.3451042 4.6004000 0.1421005 1.3618285 -3.9491171 -1.3558019
[7] 1.1272710 2.9029191 1.2091843 -6.1240475
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.5558636
[2,] -1.0824001
[3,] 0.8252925
[4,] 1.2265941
[5,] 2.3297187
>
> rowApply(tmp,sum)
[1] -2.54018236 1.63375663 6.79678935 -7.10966065 2.06150573 -5.77648390
[7] -0.09810209 1.50276137 3.20362189 1.58583507
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 1 9 8 4 8 1 3 10 8 10
[2,] 3 10 10 9 10 7 8 5 1 7
[3,] 10 2 3 7 4 3 6 7 6 3
[4,] 6 5 7 6 5 5 7 8 7 8
[5,] 5 3 1 3 3 2 9 6 10 2
[6,] 2 8 6 10 1 6 4 2 5 5
[7,] 9 7 4 2 2 8 5 9 3 6
[8,] 8 4 9 5 7 9 2 3 9 4
[9,] 4 1 2 8 9 10 10 1 4 9
[10,] 7 6 5 1 6 4 1 4 2 1
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.66831529 -1.25400371 1.98020135 -4.79042592 -2.59615290 2.50857958
[7] -0.39499157 0.88265700 -3.69408144 1.01669763 0.49443225 0.60018819
[13] -1.63072266 0.64155177 3.14891724 -1.29405159 -1.44027222 -0.06436677
[19] 0.21046563 1.54952789
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.48723994
[2,] -0.86438804
[3,] 0.01323584
[4,] 1.48920976
[5,] 1.51749767
>
> rowApply(tmp,sum)
[1] -2.371538 -0.421330 6.541885 -4.844249 -2.362304
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 20 20 7 7 3
[2,] 8 8 10 2 20
[3,] 12 14 16 17 10
[4,] 4 10 3 1 5
[5,] 11 2 8 12 9
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.48920976 -0.4879265 0.06566375 -0.82980059 -0.27110229 -0.4358931
[2,] 1.51749767 -0.2771754 0.74311082 0.09324774 -1.74503508 0.1026751
[3,] 0.01323584 0.1113079 0.83063658 -0.63668595 0.05855406 0.9729546
[4,] -0.86438804 -2.1383067 0.68228219 -2.31564464 -0.17929991 1.2738328
[5,] -1.48723994 1.5380970 -0.34149199 -1.10154247 -0.45926968 0.5950101
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.3576741 0.267849462 -0.3729580 -1.1091725 0.1978540 -0.5121794
[2,] -0.3951867 0.770369171 -0.6170421 0.7643955 1.0598328 -0.8332389
[3,] 2.4352747 -0.004589122 -0.2959507 2.0749359 0.4746510 0.1513148
[4,] 0.4587249 -0.002006884 -0.9135296 -0.1891827 -0.3697754 1.8995748
[5,] -1.5361304 -0.148965630 -1.4946011 -0.5242786 -0.8681301 -0.1052832
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 0.08303553 -1.44200056 0.3160765 1.185879 1.32492044 -0.6919635
[2,] 0.08520122 0.83323493 0.8269919 -1.342481 -1.83752894 0.3931978
[3,] -0.81893886 -0.01029783 1.7980393 -1.421595 0.08387104 0.3916334
[4,] -0.42948546 0.24543892 -0.8792149 -1.151411 0.24394590 -0.9131515
[5,] -0.55053509 1.01517631 1.0870245 1.435557 -1.25548065 0.7559170
[,19] [,20]
[1,] 0.9854739 -0.7768292
[2,] -0.7455048 0.1821087
[3,] 0.1130597 0.2204740
[4,] -0.5482962 1.2456443
[5,] 0.4057330 0.6781301
>
>
> 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 : 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 -1.282168 -0.8966849 -0.008453739 0.752242 -0.4802514 -0.36372 0.1002066
col8 col9 col10 col11 col12 col13 col14
row1 0.6149277 0.3143412 -0.01303343 0.1588647 0.135934 -1.180715 0.3582485
col15 col16 col17 col18 col19 col20
row1 -0.5751083 0.6742644 0.2435768 -0.1952895 -1.78332 -0.5612318
> tmp[,"col10"]
col10
row1 -0.01303343
row2 -0.34788747
row3 0.17466693
row4 -2.26066054
row5 0.35811369
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -1.2821677 -0.8966849 -0.008453739 0.7522420 -0.4802514 -0.3637200
row5 0.4800685 0.1295720 -0.468490121 -0.2267792 -1.6322687 0.8703178
col7 col8 col9 col10 col11 col12 col13
row1 0.1002066 0.6149277 0.31434116 -0.01303343 0.1588647 0.135934 -1.180715
row5 0.7053740 1.2856886 -0.05564302 0.35811369 0.4412662 -1.095777 1.987808
col14 col15 col16 col17 col18 col19
row1 0.3582485 -0.5751083 0.6742644 0.2435768 -0.19528946 -1.7833196
row5 0.8172096 0.5294433 0.7336831 -0.9418908 -0.03338929 -0.3620072
col20
row1 -0.5612318
row5 -0.3325616
> tmp[,c("col6","col20")]
col6 col20
row1 -0.36372000 -0.56123184
row2 -0.08118842 -0.53720293
row3 0.19528374 -0.01492649
row4 0.15717944 -0.70152940
row5 0.87031783 -0.33256158
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.3637200 -0.5612318
row5 0.8703178 -0.3325616
>
>
>
>
> 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.18007 51.46877 49.49814 51.27528 52.39704 106.026 50.15249 50.53008
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.77531 49.44556 49.31467 48.67587 51.38383 51.07501 50.33877 51.29907
col17 col18 col19 col20
row1 51.15156 49.27954 49.1562 104.9372
> tmp[,"col10"]
col10
row1 49.44556
row2 29.97250
row3 30.30591
row4 30.43866
row5 50.02243
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.18007 51.46877 49.49814 51.27528 52.39704 106.0260 50.15249 50.53008
row5 49.68805 51.03062 49.78305 49.90342 50.15512 105.2915 48.61901 49.55460
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.77531 49.44556 49.31467 48.67587 51.38383 51.07501 50.33877 51.29907
row5 49.17392 50.02243 49.45153 48.55664 49.32895 48.84890 48.66829 49.91294
col17 col18 col19 col20
row1 51.15156 49.27954 49.15620 104.9372
row5 51.82505 48.74298 48.19865 104.6062
> tmp[,c("col6","col20")]
col6 col20
row1 106.02604 104.93720
row2 74.46164 75.64615
row3 74.55792 74.51372
row4 75.15383 75.19100
row5 105.29148 104.60621
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 106.0260 104.9372
row5 105.2915 104.6062
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 106.0260 104.9372
row5 105.2915 104.6062
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -1.6283379
[2,] 1.7184712
[3,] 0.1361346
[4,] 1.0265514
[5,] -2.6660641
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.3375186 1.22109383
[2,] -0.8198365 -0.95650414
[3,] 0.5925557 0.02933066
[4,] -0.3599052 -2.81989860
[5,] -1.7242930 -2.21757279
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -0.2074068 -1.0427677
[2,] -1.7403725 1.3989031
[3,] -2.7382690 0.2502060
[4,] -0.1881954 -0.5856160
[5,] -0.3729353 0.5094928
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -0.2074068
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -0.2074068
[2,] -1.7403725
>
>
>
> 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.5770707 0.9857149 1.372636 0.07996901 1.759943 -1.5503324 1.454989
row1 0.9832374 -2.4925360 1.881855 -0.34966494 1.554907 0.9686616 -0.242993
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 -0.7515545 0.98203248 0.3061265 0.2562349 -0.9710348 0.1988260 -0.1606147
row1 0.2636147 0.06230592 0.4236323 0.2998669 0.8271129 -0.7577146 2.0903706
[,15] [,16] [,17] [,18] [,19] [,20]
row3 1.047205 -1.0173556 0.69195081 0.00222631 -0.4146404 -1.518582
row1 1.025115 -0.8704021 -0.06712474 -0.32629109 0.6236231 -1.462716
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -1.927725 0.6437442 0.6204157 0.4608506 -0.975537 0.9216124 -0.6648645
[,8] [,9] [,10]
row2 -1.428401 1.13543 1.571978
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -1.733681 0.00988553 1.48949 0.9127071 0.5160011 -1.399814 -0.8549156
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 0.8574462 0.6096621 -0.3055958 0.5750884 0.7338036 -1.848938 0.6207855
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.6613473 -0.8385218 -0.7775171 0.5109124 -1.410606 -1.2765
>
>
> 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: 0x2f0fc940>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64652551bf61"
[2] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b6465790faea"
[3] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64657d8079fb"
[4] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b646553644603"
[5] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64656402b4b7"
[6] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64653885c30"
[7] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b646563d64913"
[8] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64651f371ba4"
[9] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64652070d2a5"
[10] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64655efd8337"
[11] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b64651044596f"
[12] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b646528a39704"
[13] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b6465498ad437"
[14] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b646557bcdd6a"
[15] "/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests/BM2b646524a66481"
>
>
> ### 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: 0x30560f00>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x30560f00>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.22-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x30560f00>
> rowMedians(tmp)
[1] 0.4327952682 0.2509784621 -0.0685992740 0.5109031685 0.4839898472
[6] 0.1519263839 0.1840310478 -0.2309845097 -0.5114244982 0.3699120522
[11] -0.5270845545 -0.3038165209 0.5227396173 -0.3549814266 -0.3169941752
[16] -0.2407515010 0.7882648029 -0.2521292557 -0.0309471316 -0.1563271040
[21] 0.2710839558 0.1264249544 0.1253755791 0.2234008750 -0.3240812816
[26] 0.2162378028 -0.0284544566 0.4245098546 0.0521590890 -0.4541794080
[31] 0.0645646765 -0.5573837788 -0.6623344496 0.1004283015 -0.3940819460
[36] -0.4882013404 0.2839387185 0.2494522633 -0.2212561994 0.0182662101
[41] -0.1210062508 -0.2726731083 0.2231382413 -0.0018460045 -0.4711179546
[46] 0.0919252996 -0.4386475125 0.0459223908 -0.1203932345 -0.1362991522
[51] 0.2007381539 -0.1463119316 -0.1412338331 -0.3755278984 0.2610673271
[56] -0.3060710179 -0.0335028696 0.1038487180 -0.6856467554 -0.0568067310
[61] 0.0310769329 -0.1671218243 0.1979554853 -0.4134458769 0.4286641093
[66] -0.1229803423 -0.2535593455 -0.6400415816 -0.2472284508 -0.5836552265
[71] -0.1372249427 0.0267392615 -0.7054195680 -0.2677005076 -0.3273416646
[76] -0.2783792972 0.5748076676 0.2801360684 -0.5400114950 -0.1453477404
[81] 0.3390241038 0.3145606508 0.0002808856 -0.2413564828 -0.1569371121
[86] -0.0919131558 -0.3163219077 0.3141589021 0.2943344166 -0.0467587186
[91] -0.1023559985 -0.4814375749 0.0445214861 -0.1429356322 -0.0127484321
[96] 0.1897947124 0.3011615221 -0.2528465249 0.0760713291 -0.0010306228
[101] -0.5756088618 0.4276218969 -0.1909547659 0.0455532061 0.6104973356
[106] -0.1598535522 0.3582806069 -0.5769542045 0.1023565869 -0.3111313644
[111] 0.7001405044 -0.1495060288 0.2826601334 0.0269777578 -0.3082010750
[116] -0.2914771115 0.2241801272 0.1352585395 -0.0165653061 0.0021327748
[121] -0.3090173392 0.1862259161 0.1771869667 0.3780722522 -0.2335287755
[126] 0.0242097120 0.0948202265 0.4717061349 0.3376938991 -0.3723428800
[131] -0.2850759556 0.0594228485 -0.0367821987 0.0999894724 0.6771280265
[136] -0.0845198353 -0.1575841131 -0.3526174822 -0.0450654985 0.3158368394
[141] -0.0912509510 0.1532748830 -0.1788056969 0.2477443506 0.3084349594
[146] -0.2312525888 -0.3816057682 -0.6595074267 0.3606231401 -0.2835447069
[151] -0.2847069625 0.2722335555 0.3116928735 -0.1712940314 -0.3896587038
[156] -0.0086506180 -0.4692869918 0.3076539931 -0.6793540290 -0.1220846933
[161] -0.8050387271 0.2603568131 0.3538576020 -0.0300768665 0.1622090870
[166] -0.3993183204 0.1236663055 -0.0703439491 -0.1824947925 -0.1031888601
[171] -0.2168156792 -0.0801472425 0.2515181956 0.1350237827 -0.0029865104
[176] 0.8213925447 -0.5387297815 -0.3144616849 0.0119954756 0.1511096719
[181] 0.2762528540 0.0484192466 -0.2834124351 0.1471030115 -0.3728821421
[186] 0.1787444448 0.3111542313 -0.5633872447 -0.2062553588 -0.5049763765
[191] 0.2558648096 -0.3729210444 -0.1844544299 -0.4877104123 0.2417998897
[196] -0.0023709366 -0.1066121087 -0.2326922128 -0.0229967090 -0.1275103864
[201] 0.4941922932 0.3499172805 -0.6458830676 0.0582502729 0.1662903414
[206] -0.3671436214 -0.2941122370 -0.1242640966 -0.0602513625 -0.2187606559
[211] -0.1769994172 -0.0469404458 0.2534763838 -0.2472262615 -0.4679955991
[216] 0.2539448696 -0.3788643924 -0.3879296301 -0.0736622697 -0.2078073129
[221] -0.0016857970 -0.0700015107 -0.2862469439 0.0407095107 0.3986798314
[226] 0.7324966254 0.2513098685 0.3804590452 -0.3522742412 0.2058006921
>
> proc.time()
user system elapsed
1.881 0.903 2.811
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: 0x309c9ff0>
> .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: 0x309c9ff0>
> .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: 0x309c9ff0>
> .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: 0x309c9ff0>
> 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: 0x308af0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x308af0e0>
> .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: 0x308af0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x308af0e0>
> .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: 0x308af0e0>
> 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: 0x2f836520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2f836520>
> .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: 0x2f836520>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x2f836520>
> .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: 0x2f836520>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x2f836520>
> .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: 0x2f836520>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x2f836520>
> .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: 0x2f836520>
> 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: 0x2f23a720>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x2f23a720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2f23a720>
> .Call("R_bm_AddColumn",P)
<pointer: 0x2f23a720>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2b65fb733fcd01" "BufferedMatrixFile2b65fb74065dcc"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile2b65fb733fcd01" "BufferedMatrixFile2b65fb74065dcc"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x3012a7d0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x3012a7d0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3012a7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x3012a7d0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x3012a7d0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x3012a7d0>
> .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: 0x30231c90>
> .Call("R_bm_AddColumn",P)
<pointer: 0x30231c90>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x30231c90>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x30231c90>
> 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: 0x314da110>
> .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: 0x314da110>
> rm(P)
>
> proc.time()
user system elapsed
0.336 0.041 0.361
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.338 0.050 0.372