| Back to Multiple platform build/check report for BioC 3.24: simplified long |
|
This page was generated on 2026-05-06 11:34 -0400 (Wed, 06 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4878 |
| taishan | Linux (openEuler 24.03 LTS) | aarch64 | 4.5.0 (2025-04-11) -- "How About a Twenty-Six" | 4663 |
| 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 252/2366 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.77.0 (landing page) Ben Bolstad
| nebbiolo2 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| taishan | Linux (openEuler 24.03 LTS) / aarch64 | OK | OK | OK | ||||||||||
| See other builds for BufferedMatrix in R Universe. | ||||||||||||||
|
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.77.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.77.0.tar.gz |
| StartedAt: 2026-05-05 08:13:46 -0000 (Tue, 05 May 2026) |
| EndedAt: 2026-05-05 08:14:17 -0000 (Tue, 05 May 2026) |
| EllapsedTime: 31.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.77.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.24-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.77.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.24-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.77.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.347 0.035 0.365
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.24-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 May 5 08:14:11 2026"
> 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 May 5 08:14:11 2026"
>
>
> 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: 0x3ed17470>
>
>
>
> 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 May 5 08:14:11 2026"
> 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 May 5 08:14:11 2026"
>
> ColMode(tmp2)
<pointer: 0x3ed17470>
>
>
>
> ### 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.0722711 -1.7114108 0.9146122 2.0813998
[2,] -1.2491300 2.5802043 0.1858299 -1.3444735
[3,] 1.1749271 0.6588349 1.3478715 1.7592028
[4,] 0.3312129 0.1690485 0.5086291 -0.1312306
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.0722711 1.7114108 0.9146122 2.0813998
[2,] 1.2491300 2.5802043 0.1858299 1.3444735
[3,] 1.1749271 0.6588349 1.3478715 1.7592028
[4,] 0.3312129 0.1690485 0.5086291 0.1312306
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.003613 1.3082090 0.9563536 1.4427057
[2,] 1.117645 1.6063014 0.4310799 1.1595143
[3,] 1.083941 0.8116865 1.1609787 1.3263494
[4,] 0.575511 0.4111551 0.7131824 0.3622576
>
> 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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 225.10840 39.79350 35.47815 41.50846
[2,] 37.42558 43.64322 29.49663 37.93962
[3,] 37.01433 33.77570 37.95766 40.02270
[4,] 31.08632 29.28060 32.64045 28.75381
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x3ea18c60>
> exp(tmp5)
<pointer: 0x3ea18c60>
> log(tmp5,2)
<pointer: 0x3ea18c60>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 468.5336
> Min(tmp5)
[1] 52.77017
> mean(tmp5)
[1] 73.41394
> Sum(tmp5)
[1] 14682.79
> Var(tmp5)
[1] 873.9083
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 93.21233 71.10679 72.56182 72.19087 71.85271 70.71571 70.43957 68.35340
[9] 73.89538 69.81087
> rowSums(tmp5)
[1] 1864.247 1422.136 1451.236 1443.817 1437.054 1414.314 1408.791 1367.068
[9] 1477.908 1396.217
> rowVars(tmp5)
[1] 7911.33755 88.50149 84.77235 90.97946 86.55669 77.84905
[7] 60.71911 86.96455 69.01080 115.39136
> rowSd(tmp5)
[1] 88.945700 9.407523 9.207190 9.538315 9.303585 8.823211 7.792247
[8] 9.325478 8.307274 10.742037
> rowMax(tmp5)
[1] 468.53364 90.83764 89.30457 92.46986 94.90627 88.31045 85.17432
[8] 84.54679 89.76236 88.59770
> rowMin(tmp5)
[1] 54.70736 55.80303 53.18751 59.84728 60.70768 56.21880 60.25117 55.50612
[9] 61.37786 52.77017
>
> colMeans(tmp5)
[1] 111.70378 71.72115 71.50124 72.78268 69.33044 77.18963 71.62711
[8] 70.35587 68.79043 76.10855 66.24569 73.64956 71.69772 73.00457
[15] 69.12033 72.46008 70.80154 73.61967 68.95686 67.61194
> colSums(tmp5)
[1] 1117.0378 717.2115 715.0124 727.8268 693.3044 771.8963 716.2711
[8] 703.5587 687.9043 761.0855 662.4569 736.4956 716.9772 730.0457
[15] 691.2033 724.6008 708.0154 736.1967 689.5686 676.1194
> colVars(tmp5)
[1] 15764.57402 109.74630 47.72857 141.02475 24.48974 111.20782
[7] 48.81705 123.27889 46.08184 137.36374 115.95161 75.11006
[13] 71.85227 159.17984 101.63324 50.21961 85.16838 125.51203
[19] 84.65141 33.44622
> colSd(tmp5)
[1] 125.557055 10.475987 6.908586 11.875384 4.948711 10.545512
[7] 6.986920 11.103103 6.788361 11.720228 10.768083 8.666606
[13] 8.476572 12.616649 10.081331 7.086580 9.228672 11.203215
[19] 9.200620 5.783271
> colMax(tmp5)
[1] 468.53364 90.83764 83.17652 89.43534 76.80014 92.46986 82.64769
[8] 89.30457 77.76690 89.39071 83.94694 88.59770 89.11159 88.31045
[15] 84.54679 82.40729 83.00009 94.90627 85.06277 80.69681
> colMin(tmp5)
[1] 62.01120 60.25117 61.39337 56.68261 58.57188 60.85436 61.32120 58.70188
[9] 57.57364 55.44907 52.77017 56.06347 63.78363 54.70736 56.55223 61.24485
[17] 55.34157 60.62155 55.80303 60.70768
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 93.21233 71.10679 72.56182 72.19087 NA 70.71571 70.43957 68.35340
[9] 73.89538 69.81087
> rowSums(tmp5)
[1] 1864.247 1422.136 1451.236 1443.817 NA 1414.314 1408.791 1367.068
[9] 1477.908 1396.217
> rowVars(tmp5)
[1] 7911.33755 88.50149 84.77235 90.97946 91.07344 77.84905
[7] 60.71911 86.96455 69.01080 115.39136
> rowSd(tmp5)
[1] 88.945700 9.407523 9.207190 9.538315 9.543241 8.823211 7.792247
[8] 9.325478 8.307274 10.742037
> rowMax(tmp5)
[1] 468.53364 90.83764 89.30457 92.46986 NA 88.31045 85.17432
[8] 84.54679 89.76236 88.59770
> rowMin(tmp5)
[1] 54.70736 55.80303 53.18751 59.84728 NA 56.21880 60.25117 55.50612
[9] 61.37786 52.77017
>
> colMeans(tmp5)
[1] 111.70378 71.72115 71.50124 72.78268 69.33044 NA 71.62711
[8] 70.35587 68.79043 76.10855 66.24569 73.64956 71.69772 73.00457
[15] 69.12033 72.46008 70.80154 73.61967 68.95686 67.61194
> colSums(tmp5)
[1] 1117.0378 717.2115 715.0124 727.8268 693.3044 NA 716.2711
[8] 703.5587 687.9043 761.0855 662.4569 736.4956 716.9772 730.0457
[15] 691.2033 724.6008 708.0154 736.1967 689.5686 676.1194
> colVars(tmp5)
[1] 15764.57402 109.74630 47.72857 141.02475 24.48974 NA
[7] 48.81705 123.27889 46.08184 137.36374 115.95161 75.11006
[13] 71.85227 159.17984 101.63324 50.21961 85.16838 125.51203
[19] 84.65141 33.44622
> colSd(tmp5)
[1] 125.557055 10.475987 6.908586 11.875384 4.948711 NA
[7] 6.986920 11.103103 6.788361 11.720228 10.768083 8.666606
[13] 8.476572 12.616649 10.081331 7.086580 9.228672 11.203215
[19] 9.200620 5.783271
> colMax(tmp5)
[1] 468.53364 90.83764 83.17652 89.43534 76.80014 NA 82.64769
[8] 89.30457 77.76690 89.39071 83.94694 88.59770 89.11159 88.31045
[15] 84.54679 82.40729 83.00009 94.90627 85.06277 80.69681
> colMin(tmp5)
[1] 62.01120 60.25117 61.39337 56.68261 58.57188 NA 61.32120 58.70188
[9] 57.57364 55.44907 52.77017 56.06347 63.78363 54.70736 56.55223 61.24485
[17] 55.34157 60.62155 55.80303 60.70768
>
> Max(tmp5,na.rm=TRUE)
[1] 468.5336
> Min(tmp5,na.rm=TRUE)
[1] 52.77017
> mean(tmp5,na.rm=TRUE)
[1] 73.41056
> Sum(tmp5,na.rm=TRUE)
[1] 14608.7
> Var(tmp5,na.rm=TRUE)
[1] 878.3196
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.21233 71.10679 72.56182 72.19087 71.73511 70.71571 70.43957 68.35340
[9] 73.89538 69.81087
> rowSums(tmp5,na.rm=TRUE)
[1] 1864.247 1422.136 1451.236 1443.817 1362.967 1414.314 1408.791 1367.068
[9] 1477.908 1396.217
> rowVars(tmp5,na.rm=TRUE)
[1] 7911.33755 88.50149 84.77235 90.97946 91.07344 77.84905
[7] 60.71911 86.96455 69.01080 115.39136
> rowSd(tmp5,na.rm=TRUE)
[1] 88.945700 9.407523 9.207190 9.538315 9.543241 8.823211 7.792247
[8] 9.325478 8.307274 10.742037
> rowMax(tmp5,na.rm=TRUE)
[1] 468.53364 90.83764 89.30457 92.46986 94.90627 88.31045 85.17432
[8] 84.54679 89.76236 88.59770
> rowMin(tmp5,na.rm=TRUE)
[1] 54.70736 55.80303 53.18751 59.84728 60.70768 56.21880 60.25117 55.50612
[9] 61.37786 52.77017
>
> colMeans(tmp5,na.rm=TRUE)
[1] 111.70378 71.72115 71.50124 72.78268 69.33044 77.53436 71.62711
[8] 70.35587 68.79043 76.10855 66.24569 73.64956 71.69772 73.00457
[15] 69.12033 72.46008 70.80154 73.61967 68.95686 67.61194
> colSums(tmp5,na.rm=TRUE)
[1] 1117.0378 717.2115 715.0124 727.8268 693.3044 697.8092 716.2711
[8] 703.5587 687.9043 761.0855 662.4569 736.4956 716.9772 730.0457
[15] 691.2033 724.6008 708.0154 736.1967 689.5686 676.1194
> colVars(tmp5,na.rm=TRUE)
[1] 15764.57402 109.74630 47.72857 141.02475 24.48974 123.77186
[7] 48.81705 123.27889 46.08184 137.36374 115.95161 75.11006
[13] 71.85227 159.17984 101.63324 50.21961 85.16838 125.51203
[19] 84.65141 33.44622
> colSd(tmp5,na.rm=TRUE)
[1] 125.557055 10.475987 6.908586 11.875384 4.948711 11.125280
[7] 6.986920 11.103103 6.788361 11.720228 10.768083 8.666606
[13] 8.476572 12.616649 10.081331 7.086580 9.228672 11.203215
[19] 9.200620 5.783271
> colMax(tmp5,na.rm=TRUE)
[1] 468.53364 90.83764 83.17652 89.43534 76.80014 92.46986 82.64769
[8] 89.30457 77.76690 89.39071 83.94694 88.59770 89.11159 88.31045
[15] 84.54679 82.40729 83.00009 94.90627 85.06277 80.69681
> colMin(tmp5,na.rm=TRUE)
[1] 62.01120 60.25117 61.39337 56.68261 58.57188 60.85436 61.32120 58.70188
[9] 57.57364 55.44907 52.77017 56.06347 63.78363 54.70736 56.55223 61.24485
[17] 55.34157 60.62155 55.80303 60.70768
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 93.21233 71.10679 72.56182 72.19087 NaN 70.71571 70.43957 68.35340
[9] 73.89538 69.81087
> rowSums(tmp5,na.rm=TRUE)
[1] 1864.247 1422.136 1451.236 1443.817 0.000 1414.314 1408.791 1367.068
[9] 1477.908 1396.217
> rowVars(tmp5,na.rm=TRUE)
[1] 7911.33755 88.50149 84.77235 90.97946 NA 77.84905
[7] 60.71911 86.96455 69.01080 115.39136
> rowSd(tmp5,na.rm=TRUE)
[1] 88.945700 9.407523 9.207190 9.538315 NA 8.823211 7.792247
[8] 9.325478 8.307274 10.742037
> rowMax(tmp5,na.rm=TRUE)
[1] 468.53364 90.83764 89.30457 92.46986 NA 88.31045 85.17432
[8] 84.54679 89.76236 88.59770
> rowMin(tmp5,na.rm=TRUE)
[1] 54.70736 55.80303 53.18751 59.84728 NA 56.21880 60.25117 55.50612
[9] 61.37786 52.77017
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 116.17587 72.20672 72.16178 72.34089 68.97495 NaN 72.77221
[8] 70.52016 69.58818 75.08942 66.42354 74.08471 72.47616 74.12425
[15] 67.92232 71.35483 69.44615 71.25450 68.91819 68.37908
> colSums(tmp5,na.rm=TRUE)
[1] 1045.5828 649.8605 649.4560 651.0680 620.7745 0.0000 654.9499
[8] 634.6814 626.2936 675.8048 597.8119 666.7624 652.2854 667.1183
[15] 611.3009 642.1935 625.0153 641.2905 620.2637 615.4117
> colVars(tmp5,na.rm=TRUE)
[1] 17510.15114 120.81210 48.78623 156.45712 26.12926 NA
[7] 40.16755 138.38510 44.68259 142.84967 130.08972 82.36854
[13] 74.01660 164.97322 98.19096 42.75442 75.14715 78.26783
[19] 95.21601 31.00633
> colSd(tmp5,na.rm=TRUE)
[1] 132.325928 10.991456 6.984714 12.508282 5.111678 NA
[7] 6.337787 11.763720 6.684504 11.951973 11.405688 9.075711
[13] 8.603290 12.844190 9.909135 6.538686 8.668745 8.846911
[19] 9.757869 5.568333
> colMax(tmp5,na.rm=TRUE)
[1] 468.53364 90.83764 83.17652 89.43534 76.80014 -Inf 82.64769
[8] 89.30457 77.76690 89.39071 83.94694 88.59770 89.11159 88.31045
[15] 84.54679 79.55170 82.65650 87.78593 85.06277 80.69681
> colMin(tmp5,na.rm=TRUE)
[1] 62.01120 60.25117 61.39337 56.68261 58.57188 Inf 66.20167 58.70188
[9] 57.57364 55.44907 52.77017 56.06347 63.78363 54.70736 56.55223 61.24485
[17] 55.34157 60.62155 55.80303 61.48634
>
>
>
>
> 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] 140.9969 359.1515 137.5632 189.9194 176.3464 309.2618 143.7468 173.9864
[9] 187.9717 127.4316
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 140.9969 359.1515 137.5632 189.9194 176.3464 309.2618 143.7468 173.9864
[9] 187.9717 127.4316
>
>
>
> copymatrix <- matrix(rnorm(200,150,15),10,20)
>
> tmp5[1:10,1:20] <- copymatrix
> which.row <- 1
> which.col <- 3
> cat(which.row," ",which.col,"\n")
1 3
> tmp5[which.row,which.col] <- NA
> copymatrix[which.row,which.col] <- NA
>
> colVars(tmp5,na.rm=TRUE)-apply(copymatrix,2,var,na.rm=TRUE)
[1] -1.705303e-13 -3.410605e-13 0.000000e+00 2.842171e-14 -7.105427e-14
[6] 1.705303e-13 0.000000e+00 -1.136868e-13 5.684342e-14 1.136868e-13
[11] 2.842171e-14 -1.136868e-13 1.136868e-13 -2.842171e-14 -5.684342e-14
[16] 0.000000e+00 8.526513e-14 -5.684342e-14 -5.684342e-14 -9.237056e-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)
+ }
9 15
5 14
3 6
7 2
9 1
10 5
9 4
8 1
9 7
3 9
9 1
3 7
9 14
8 15
1 13
1 13
4 12
4 8
7 2
10 6
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.227503
> Min(tmp)
[1] -1.9642
> mean(tmp)
[1] -0.1006326
> Sum(tmp)
[1] -10.06326
> Var(tmp)
[1] 0.8772789
>
> rowMeans(tmp)
[1] -0.1006326
> rowSums(tmp)
[1] -10.06326
> rowVars(tmp)
[1] 0.8772789
> rowSd(tmp)
[1] 0.9366317
> rowMax(tmp)
[1] 2.227503
> rowMin(tmp)
[1] -1.9642
>
> colMeans(tmp)
[1] 0.300480616 1.181537170 0.188222523 1.023445173 -1.650027364
[6] 0.479179580 1.308894880 -0.886643190 -0.377652394 0.681811959
[11] -0.288130387 0.203695681 1.928250432 0.650716817 0.857630977
[16] 0.009077369 0.423641090 -1.472729879 0.591675771 -0.019875082
[21] -0.377998081 0.449163407 0.984095697 0.284362464 0.196907994
[26] -0.432486797 -0.082030857 0.184541755 0.190737933 -0.403079662
[31] 0.732452359 0.114357155 0.620166419 0.454619912 -0.588635780
[36] -1.498786445 -0.958175946 0.156248535 -1.362685893 1.493585628
[41] -1.802874711 0.870190088 -1.012718813 -0.959042502 1.160831924
[46] -1.168275939 -0.760103135 0.587557090 1.693098138 0.548853324
[51] -0.727446025 0.937812394 -1.964200229 -0.775553230 -0.648838453
[56] -0.309460438 -1.124552362 -0.632758451 -0.484225603 -1.152073462
[61] 0.810545306 -1.382759504 -1.362867068 -0.599969070 0.705306168
[66] -1.326323533 0.778390985 0.474944195 -1.298181531 1.196569628
[71] -1.317861851 -0.915942218 -0.373071828 -0.713580642 -0.901450415
[76] 1.006380932 -1.413726204 0.459431271 -0.967839547 -0.455011692
[81] 1.787506037 -0.158729965 0.460388595 -0.470524374 1.359081433
[86] 2.227503428 -0.429977856 -1.294139506 -0.826273381 -1.051289034
[91] -0.293875868 -0.203351028 -0.681173476 -0.509062375 -0.033431983
[96] 0.100075454 -0.700271252 -1.024642661 1.621312852 0.087849743
> colSums(tmp)
[1] 0.300480616 1.181537170 0.188222523 1.023445173 -1.650027364
[6] 0.479179580 1.308894880 -0.886643190 -0.377652394 0.681811959
[11] -0.288130387 0.203695681 1.928250432 0.650716817 0.857630977
[16] 0.009077369 0.423641090 -1.472729879 0.591675771 -0.019875082
[21] -0.377998081 0.449163407 0.984095697 0.284362464 0.196907994
[26] -0.432486797 -0.082030857 0.184541755 0.190737933 -0.403079662
[31] 0.732452359 0.114357155 0.620166419 0.454619912 -0.588635780
[36] -1.498786445 -0.958175946 0.156248535 -1.362685893 1.493585628
[41] -1.802874711 0.870190088 -1.012718813 -0.959042502 1.160831924
[46] -1.168275939 -0.760103135 0.587557090 1.693098138 0.548853324
[51] -0.727446025 0.937812394 -1.964200229 -0.775553230 -0.648838453
[56] -0.309460438 -1.124552362 -0.632758451 -0.484225603 -1.152073462
[61] 0.810545306 -1.382759504 -1.362867068 -0.599969070 0.705306168
[66] -1.326323533 0.778390985 0.474944195 -1.298181531 1.196569628
[71] -1.317861851 -0.915942218 -0.373071828 -0.713580642 -0.901450415
[76] 1.006380932 -1.413726204 0.459431271 -0.967839547 -0.455011692
[81] 1.787506037 -0.158729965 0.460388595 -0.470524374 1.359081433
[86] 2.227503428 -0.429977856 -1.294139506 -0.826273381 -1.051289034
[91] -0.293875868 -0.203351028 -0.681173476 -0.509062375 -0.033431983
[96] 0.100075454 -0.700271252 -1.024642661 1.621312852 0.087849743
> 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.300480616 1.181537170 0.188222523 1.023445173 -1.650027364
[6] 0.479179580 1.308894880 -0.886643190 -0.377652394 0.681811959
[11] -0.288130387 0.203695681 1.928250432 0.650716817 0.857630977
[16] 0.009077369 0.423641090 -1.472729879 0.591675771 -0.019875082
[21] -0.377998081 0.449163407 0.984095697 0.284362464 0.196907994
[26] -0.432486797 -0.082030857 0.184541755 0.190737933 -0.403079662
[31] 0.732452359 0.114357155 0.620166419 0.454619912 -0.588635780
[36] -1.498786445 -0.958175946 0.156248535 -1.362685893 1.493585628
[41] -1.802874711 0.870190088 -1.012718813 -0.959042502 1.160831924
[46] -1.168275939 -0.760103135 0.587557090 1.693098138 0.548853324
[51] -0.727446025 0.937812394 -1.964200229 -0.775553230 -0.648838453
[56] -0.309460438 -1.124552362 -0.632758451 -0.484225603 -1.152073462
[61] 0.810545306 -1.382759504 -1.362867068 -0.599969070 0.705306168
[66] -1.326323533 0.778390985 0.474944195 -1.298181531 1.196569628
[71] -1.317861851 -0.915942218 -0.373071828 -0.713580642 -0.901450415
[76] 1.006380932 -1.413726204 0.459431271 -0.967839547 -0.455011692
[81] 1.787506037 -0.158729965 0.460388595 -0.470524374 1.359081433
[86] 2.227503428 -0.429977856 -1.294139506 -0.826273381 -1.051289034
[91] -0.293875868 -0.203351028 -0.681173476 -0.509062375 -0.033431983
[96] 0.100075454 -0.700271252 -1.024642661 1.621312852 0.087849743
> colMin(tmp)
[1] 0.300480616 1.181537170 0.188222523 1.023445173 -1.650027364
[6] 0.479179580 1.308894880 -0.886643190 -0.377652394 0.681811959
[11] -0.288130387 0.203695681 1.928250432 0.650716817 0.857630977
[16] 0.009077369 0.423641090 -1.472729879 0.591675771 -0.019875082
[21] -0.377998081 0.449163407 0.984095697 0.284362464 0.196907994
[26] -0.432486797 -0.082030857 0.184541755 0.190737933 -0.403079662
[31] 0.732452359 0.114357155 0.620166419 0.454619912 -0.588635780
[36] -1.498786445 -0.958175946 0.156248535 -1.362685893 1.493585628
[41] -1.802874711 0.870190088 -1.012718813 -0.959042502 1.160831924
[46] -1.168275939 -0.760103135 0.587557090 1.693098138 0.548853324
[51] -0.727446025 0.937812394 -1.964200229 -0.775553230 -0.648838453
[56] -0.309460438 -1.124552362 -0.632758451 -0.484225603 -1.152073462
[61] 0.810545306 -1.382759504 -1.362867068 -0.599969070 0.705306168
[66] -1.326323533 0.778390985 0.474944195 -1.298181531 1.196569628
[71] -1.317861851 -0.915942218 -0.373071828 -0.713580642 -0.901450415
[76] 1.006380932 -1.413726204 0.459431271 -0.967839547 -0.455011692
[81] 1.787506037 -0.158729965 0.460388595 -0.470524374 1.359081433
[86] 2.227503428 -0.429977856 -1.294139506 -0.826273381 -1.051289034
[91] -0.293875868 -0.203351028 -0.681173476 -0.509062375 -0.033431983
[96] 0.100075454 -0.700271252 -1.024642661 1.621312852 0.087849743
> colMedians(tmp)
[1] 0.300480616 1.181537170 0.188222523 1.023445173 -1.650027364
[6] 0.479179580 1.308894880 -0.886643190 -0.377652394 0.681811959
[11] -0.288130387 0.203695681 1.928250432 0.650716817 0.857630977
[16] 0.009077369 0.423641090 -1.472729879 0.591675771 -0.019875082
[21] -0.377998081 0.449163407 0.984095697 0.284362464 0.196907994
[26] -0.432486797 -0.082030857 0.184541755 0.190737933 -0.403079662
[31] 0.732452359 0.114357155 0.620166419 0.454619912 -0.588635780
[36] -1.498786445 -0.958175946 0.156248535 -1.362685893 1.493585628
[41] -1.802874711 0.870190088 -1.012718813 -0.959042502 1.160831924
[46] -1.168275939 -0.760103135 0.587557090 1.693098138 0.548853324
[51] -0.727446025 0.937812394 -1.964200229 -0.775553230 -0.648838453
[56] -0.309460438 -1.124552362 -0.632758451 -0.484225603 -1.152073462
[61] 0.810545306 -1.382759504 -1.362867068 -0.599969070 0.705306168
[66] -1.326323533 0.778390985 0.474944195 -1.298181531 1.196569628
[71] -1.317861851 -0.915942218 -0.373071828 -0.713580642 -0.901450415
[76] 1.006380932 -1.413726204 0.459431271 -0.967839547 -0.455011692
[81] 1.787506037 -0.158729965 0.460388595 -0.470524374 1.359081433
[86] 2.227503428 -0.429977856 -1.294139506 -0.826273381 -1.051289034
[91] -0.293875868 -0.203351028 -0.681173476 -0.509062375 -0.033431983
[96] 0.100075454 -0.700271252 -1.024642661 1.621312852 0.087849743
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.3004806 1.181537 0.1882225 1.023445 -1.650027 0.4791796 1.308895
[2,] 0.3004806 1.181537 0.1882225 1.023445 -1.650027 0.4791796 1.308895
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.8866432 -0.3776524 0.681812 -0.2881304 0.2036957 1.92825 0.6507168
[2,] -0.8866432 -0.3776524 0.681812 -0.2881304 0.2036957 1.92825 0.6507168
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] 0.857631 0.009077369 0.4236411 -1.47273 0.5916758 -0.01987508 -0.3779981
[2,] 0.857631 0.009077369 0.4236411 -1.47273 0.5916758 -0.01987508 -0.3779981
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.4491634 0.9840957 0.2843625 0.196908 -0.4324868 -0.08203086 0.1845418
[2,] 0.4491634 0.9840957 0.2843625 0.196908 -0.4324868 -0.08203086 0.1845418
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.1907379 -0.4030797 0.7324524 0.1143572 0.6201664 0.4546199 -0.5886358
[2,] 0.1907379 -0.4030797 0.7324524 0.1143572 0.6201664 0.4546199 -0.5886358
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -1.498786 -0.9581759 0.1562485 -1.362686 1.493586 -1.802875 0.8701901
[2,] -1.498786 -0.9581759 0.1562485 -1.362686 1.493586 -1.802875 0.8701901
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.012719 -0.9590425 1.160832 -1.168276 -0.7601031 0.5875571 1.693098
[2,] -1.012719 -0.9590425 1.160832 -1.168276 -0.7601031 0.5875571 1.693098
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 0.5488533 -0.727446 0.9378124 -1.9642 -0.7755532 -0.6488385 -0.3094604
[2,] 0.5488533 -0.727446 0.9378124 -1.9642 -0.7755532 -0.6488385 -0.3094604
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -1.124552 -0.6327585 -0.4842256 -1.152073 0.8105453 -1.38276 -1.362867
[2,] -1.124552 -0.6327585 -0.4842256 -1.152073 0.8105453 -1.38276 -1.362867
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.5999691 0.7053062 -1.326324 0.778391 0.4749442 -1.298182 1.19657
[2,] -0.5999691 0.7053062 -1.326324 0.778391 0.4749442 -1.298182 1.19657
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] -1.317862 -0.9159422 -0.3730718 -0.7135806 -0.9014504 1.006381 -1.413726
[2,] -1.317862 -0.9159422 -0.3730718 -0.7135806 -0.9014504 1.006381 -1.413726
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] 0.4594313 -0.9678395 -0.4550117 1.787506 -0.15873 0.4603886 -0.4705244
[2,] 0.4594313 -0.9678395 -0.4550117 1.787506 -0.15873 0.4603886 -0.4705244
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 1.359081 2.227503 -0.4299779 -1.29414 -0.8262734 -1.051289 -0.2938759
[2,] 1.359081 2.227503 -0.4299779 -1.29414 -0.8262734 -1.051289 -0.2938759
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.203351 -0.6811735 -0.5090624 -0.03343198 0.1000755 -0.7002713 -1.024643
[2,] -0.203351 -0.6811735 -0.5090624 -0.03343198 0.1000755 -0.7002713 -1.024643
[,99] [,100]
[1,] 1.621313 0.08784974
[2,] 1.621313 0.08784974
>
>
> Max(tmp2)
[1] 2.411656
> Min(tmp2)
[1] -1.864363
> mean(tmp2)
[1] 0.05866816
> Sum(tmp2)
[1] 5.866816
> Var(tmp2)
[1] 0.8651763
>
> rowMeans(tmp2)
[1] 0.07912760 -0.80696568 -0.17778175 -1.05895601 -0.65412443 -1.78042897
[7] 0.58203566 0.73467470 -0.45079480 0.65970768 -1.00142465 -1.54627288
[13] -0.06744723 0.06445330 1.06143244 0.24118442 -0.79670172 0.87053575
[19] 0.01845841 0.89180174 -1.63778235 0.25544213 1.64840309 1.19053190
[25] 0.35069125 -0.50402511 0.83247695 -0.77839144 -0.12570538 -1.56260182
[31] 1.37917414 0.67272875 0.04601866 -0.41749751 0.02117452 0.24095453
[37] -0.38219377 1.24289374 0.87293331 -0.07006711 -0.47165488 -0.13823266
[43] 0.53579935 -0.15907241 0.25758476 0.29762315 0.16721761 -0.91757626
[49] -1.56736730 1.77557472 2.41165631 1.93857898 -0.08629667 1.89660301
[55] -0.22733753 0.26753226 -0.49178094 0.14272205 0.83830416 -1.86436290
[61] -1.12589370 -0.79247458 0.52348858 1.44106526 0.24408959 -0.24897513
[67] -1.17248036 0.23543683 -0.72773060 1.43405335 1.14294051 0.50566755
[73] -0.32832200 -1.70958740 -1.03894852 -1.41210854 1.56185603 1.27714107
[79] -0.74534761 1.16996617 0.09123336 -0.47963728 -0.13673221 0.26501334
[85] 0.52110948 -0.92563370 0.90005263 -0.39073348 1.20213347 0.29262708
[91] 0.23674377 1.01853353 -0.87998101 -0.11014181 0.38677517 -0.64648805
[97] -1.31327362 0.98817261 -0.33949010 0.20950911
> rowSums(tmp2)
[1] 0.07912760 -0.80696568 -0.17778175 -1.05895601 -0.65412443 -1.78042897
[7] 0.58203566 0.73467470 -0.45079480 0.65970768 -1.00142465 -1.54627288
[13] -0.06744723 0.06445330 1.06143244 0.24118442 -0.79670172 0.87053575
[19] 0.01845841 0.89180174 -1.63778235 0.25544213 1.64840309 1.19053190
[25] 0.35069125 -0.50402511 0.83247695 -0.77839144 -0.12570538 -1.56260182
[31] 1.37917414 0.67272875 0.04601866 -0.41749751 0.02117452 0.24095453
[37] -0.38219377 1.24289374 0.87293331 -0.07006711 -0.47165488 -0.13823266
[43] 0.53579935 -0.15907241 0.25758476 0.29762315 0.16721761 -0.91757626
[49] -1.56736730 1.77557472 2.41165631 1.93857898 -0.08629667 1.89660301
[55] -0.22733753 0.26753226 -0.49178094 0.14272205 0.83830416 -1.86436290
[61] -1.12589370 -0.79247458 0.52348858 1.44106526 0.24408959 -0.24897513
[67] -1.17248036 0.23543683 -0.72773060 1.43405335 1.14294051 0.50566755
[73] -0.32832200 -1.70958740 -1.03894852 -1.41210854 1.56185603 1.27714107
[79] -0.74534761 1.16996617 0.09123336 -0.47963728 -0.13673221 0.26501334
[85] 0.52110948 -0.92563370 0.90005263 -0.39073348 1.20213347 0.29262708
[91] 0.23674377 1.01853353 -0.87998101 -0.11014181 0.38677517 -0.64648805
[97] -1.31327362 0.98817261 -0.33949010 0.20950911
> 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.07912760 -0.80696568 -0.17778175 -1.05895601 -0.65412443 -1.78042897
[7] 0.58203566 0.73467470 -0.45079480 0.65970768 -1.00142465 -1.54627288
[13] -0.06744723 0.06445330 1.06143244 0.24118442 -0.79670172 0.87053575
[19] 0.01845841 0.89180174 -1.63778235 0.25544213 1.64840309 1.19053190
[25] 0.35069125 -0.50402511 0.83247695 -0.77839144 -0.12570538 -1.56260182
[31] 1.37917414 0.67272875 0.04601866 -0.41749751 0.02117452 0.24095453
[37] -0.38219377 1.24289374 0.87293331 -0.07006711 -0.47165488 -0.13823266
[43] 0.53579935 -0.15907241 0.25758476 0.29762315 0.16721761 -0.91757626
[49] -1.56736730 1.77557472 2.41165631 1.93857898 -0.08629667 1.89660301
[55] -0.22733753 0.26753226 -0.49178094 0.14272205 0.83830416 -1.86436290
[61] -1.12589370 -0.79247458 0.52348858 1.44106526 0.24408959 -0.24897513
[67] -1.17248036 0.23543683 -0.72773060 1.43405335 1.14294051 0.50566755
[73] -0.32832200 -1.70958740 -1.03894852 -1.41210854 1.56185603 1.27714107
[79] -0.74534761 1.16996617 0.09123336 -0.47963728 -0.13673221 0.26501334
[85] 0.52110948 -0.92563370 0.90005263 -0.39073348 1.20213347 0.29262708
[91] 0.23674377 1.01853353 -0.87998101 -0.11014181 0.38677517 -0.64648805
[97] -1.31327362 0.98817261 -0.33949010 0.20950911
> rowMin(tmp2)
[1] 0.07912760 -0.80696568 -0.17778175 -1.05895601 -0.65412443 -1.78042897
[7] 0.58203566 0.73467470 -0.45079480 0.65970768 -1.00142465 -1.54627288
[13] -0.06744723 0.06445330 1.06143244 0.24118442 -0.79670172 0.87053575
[19] 0.01845841 0.89180174 -1.63778235 0.25544213 1.64840309 1.19053190
[25] 0.35069125 -0.50402511 0.83247695 -0.77839144 -0.12570538 -1.56260182
[31] 1.37917414 0.67272875 0.04601866 -0.41749751 0.02117452 0.24095453
[37] -0.38219377 1.24289374 0.87293331 -0.07006711 -0.47165488 -0.13823266
[43] 0.53579935 -0.15907241 0.25758476 0.29762315 0.16721761 -0.91757626
[49] -1.56736730 1.77557472 2.41165631 1.93857898 -0.08629667 1.89660301
[55] -0.22733753 0.26753226 -0.49178094 0.14272205 0.83830416 -1.86436290
[61] -1.12589370 -0.79247458 0.52348858 1.44106526 0.24408959 -0.24897513
[67] -1.17248036 0.23543683 -0.72773060 1.43405335 1.14294051 0.50566755
[73] -0.32832200 -1.70958740 -1.03894852 -1.41210854 1.56185603 1.27714107
[79] -0.74534761 1.16996617 0.09123336 -0.47963728 -0.13673221 0.26501334
[85] 0.52110948 -0.92563370 0.90005263 -0.39073348 1.20213347 0.29262708
[91] 0.23674377 1.01853353 -0.87998101 -0.11014181 0.38677517 -0.64648805
[97] -1.31327362 0.98817261 -0.33949010 0.20950911
>
> colMeans(tmp2)
[1] 0.05866816
> colSums(tmp2)
[1] 5.866816
> colVars(tmp2)
[1] 0.8651763
> colSd(tmp2)
[1] 0.9301485
> colMax(tmp2)
[1] 2.411656
> colMin(tmp2)
[1] -1.864363
> colMedians(tmp2)
[1] 0.07179045
> colRanges(tmp2)
[,1]
[1,] -1.864363
[2,] 2.411656
>
> 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] -0.08496657 3.25834215 1.77503643 -1.75782333 3.47420665 0.56211222
[7] -1.18536663 -0.01946918 3.94468612 -1.58945145
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.29199675
[2,] -0.72277421
[3,] 0.01352491
[4,] 0.61163702
[5,] 1.60984107
>
> rowApply(tmp,sum)
[1] 3.0537799 3.3115322 4.6089478 0.9174788 -3.1580064 -3.2042767
[7] 1.6119235 -1.4587678 3.2785575 -0.5838624
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 4 2 9 5 10 3 1 4 7 7
[2,] 10 8 5 10 3 1 8 8 3 6
[3,] 8 6 1 1 8 4 9 7 5 8
[4,] 1 4 2 4 5 9 3 6 9 5
[5,] 5 10 6 6 9 7 7 9 4 3
[6,] 3 1 3 8 7 6 10 2 10 4
[7,] 2 7 7 2 1 8 5 3 6 10
[8,] 9 5 10 9 4 2 6 5 1 1
[9,] 7 3 4 7 2 10 4 10 2 9
[10,] 6 9 8 3 6 5 2 1 8 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 1.62968259 -0.40413928 -6.19091804 -0.45929365 3.28474387 -0.13679044
[7] -3.90766021 -2.35945128 0.02965501 2.25408663 1.12589873 -2.50415337
[13] 1.46591794 1.41416595 -4.50837641 0.89840024 -1.06984654 -1.07414006
[19] 0.22641147 1.50953099
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.4646308
[2,] -0.2953374
[3,] 0.5966708
[4,] 0.7612381
[5,] 1.0317419
>
> rowApply(tmp,sum)
[1] 0.135496 3.614791 -7.799367 2.545965 -7.273162
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 7 15 11 12 17
[2,] 20 9 2 4 12
[3,] 11 1 4 2 5
[4,] 2 8 18 17 11
[5,] 10 14 16 15 20
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.4646308 2.57367924 -0.04835067 -1.70194711 -0.05324114 0.3064084
[2,] 1.0317419 0.05954724 -1.72466406 0.03286756 0.72610645 -0.5350593
[3,] -0.2953374 -1.68903878 -1.34609087 0.58346693 0.29008921 -0.1842086
[4,] 0.7612381 -0.94297457 -1.86404995 1.04371384 0.91051871 0.8006747
[5,] 0.5966708 -0.40535241 -1.20776249 -0.41739487 1.41127065 -0.5246057
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] -1.7868644 -1.3944044 -0.5903702 -1.0978532 0.4377562 -0.28819189
[2,] -0.8618342 1.1472802 0.5289173 -1.0725070 1.8560987 0.09651044
[3,] -0.4966596 -1.5537494 0.1710752 2.2327214 0.7676023 -2.36490622
[4,] 1.2245067 -1.1230069 0.3459249 1.2699584 -0.2239430 0.54232745
[5,] -1.9868086 0.5644293 -0.4258923 0.9217671 -1.7116154 -0.48989316
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.6562353 0.6210859 -0.4252283 0.30612116 0.002500364 -0.7321238
[2,] 1.1417997 1.3552548 -1.0523094 1.26865212 0.131204511 -0.1883654
[3,] -0.5286917 -1.2332264 -0.5720249 -0.06672985 -0.797001243 -0.2478869
[4,] -0.5761667 -0.4327692 -1.9080622 1.03878235 -0.783943630 -0.2813143
[5,] -0.2272585 1.1038210 -0.5507517 -1.64842555 0.377393456 0.3755503
[,19] [,20]
[1,] 1.3144940 1.5004214
[2,] -0.8798445 0.5533942
[3,] -0.9740544 0.5052848
[4,] 1.9710165 0.7735341
[5,] -1.2052002 -1.8231035
>
>
> 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.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 654 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.24-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.24-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 480 bytes.
>
>
> rm(tmp)
>
>
> ###
> ### Testing colnames and rownames
> ###
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
>
>
> colnames(tmp)
NULL
> rownames(tmp)
NULL
>
>
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
> colnames(tmp)
[1] "col1" "col2" "col3" "col4" "col5" "col6" "col7" "col8" "col9"
[10] "col10" "col11" "col12" "col13" "col14" "col15" "col16" "col17" "col18"
[19] "col19" "col20"
> rownames(tmp)
[1] "row1" "row2" "row3" "row4" "row5"
>
>
> tmp["row1",]
col1 col2 col3 col4 col5 col6 col7
row1 -0.1381047 1.482776 1.389591 1.205991 0.6864966 -0.9573607 0.3471255
col8 col9 col10 col11 col12 col13 col14
row1 0.1299302 -0.2326994 -0.8826657 1.43434 1.809891 -0.29036 -0.4112271
col15 col16 col17 col18 col19 col20
row1 0.3095864 -0.7741387 0.5869489 1.18604 -0.750385 1.031131
> tmp[,"col10"]
col10
row1 -0.8826657
row2 0.1521534
row3 -1.2910768
row4 0.5855390
row5 -0.6714425
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 -0.1381047 1.4827760 1.389591 1.205991 0.6864966 -0.9573607 0.3471255
row5 0.3639500 -0.1546811 1.132054 -1.539270 -0.1317163 0.1170369 1.2562506
col8 col9 col10 col11 col12 col13 col14
row1 0.12993018 -0.2326994 -0.8826657 1.434340 1.809891 -0.2903600 -0.4112271
row5 -0.01668896 0.9511312 -0.6714425 -1.631024 1.493221 -0.6406085 0.4336915
col15 col16 col17 col18 col19 col20
row1 0.3095864 -0.7741387 0.5869489 1.1860402 -0.7503850 1.0311308
row5 -1.6800980 0.9846813 1.6400632 -0.7347697 -0.7317866 -0.1255667
> tmp[,c("col6","col20")]
col6 col20
row1 -0.9573607 1.0311308
row2 0.9412107 -1.5064669
row3 -0.4588852 0.3226563
row4 1.8106663 0.6887882
row5 0.1170369 -0.1255667
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.9573607 1.0311308
row5 0.1170369 -0.1255667
>
>
>
>
> 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.80208 51.00243 50.59039 50.13675 49.4417 104.6677 47.48335 50.62929
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.60928 49.42866 50.04641 49.26974 48.81448 49.72525 49.82973 48.53733
col17 col18 col19 col20
row1 50.69987 48.45095 49.49925 104.0112
> tmp[,"col10"]
col10
row1 49.42866
row2 31.10900
row3 29.60848
row4 31.03699
row5 49.35092
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.80208 51.00243 50.59039 50.13675 49.44170 104.6677 47.48335 50.62929
row5 48.40857 49.68741 48.15878 49.65718 50.73197 104.3581 49.76677 52.40673
col9 col10 col11 col12 col13 col14 col15 col16
row1 48.60928 49.42866 50.04641 49.26974 48.81448 49.72525 49.82973 48.53733
row5 49.21892 49.35092 50.57900 49.54038 48.27063 48.48767 51.26586 51.46432
col17 col18 col19 col20
row1 50.69987 48.45095 49.49925 104.0112
row5 49.82029 50.93679 51.62013 105.0248
> tmp[,c("col6","col20")]
col6 col20
row1 104.66766 104.01117
row2 74.71899 75.15015
row3 74.92908 75.52403
row4 74.16997 76.62036
row5 104.35808 105.02479
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 104.6677 104.0112
row5 104.3581 105.0248
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 104.6677 104.0112
row5 104.3581 105.0248
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] 1.2715289
[2,] -0.3498431
[3,] -1.0899059
[4,] 1.0059912
[5,] -0.3269612
> tmp[,c("col17","col7")]
col17 col7
[1,] -0.3187766 -1.5797328
[2,] -0.3266054 0.3629198
[3,] 1.1006464 0.4287097
[4,] 0.3465939 -0.3759908
[5,] 0.7965003 -0.2232413
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.5076981 1.4395233
[2,] 1.9429789 0.1229693
[3,] -1.2333135 -0.7408025
[4,] 0.5511921 -1.2229488
[5,] 0.9526682 -0.7451415
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.507698
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.507698
[2,] 1.942979
>
>
>
> 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 1.901462 0.9201812 -0.4814823 0.7414250 -2.4325227 0.43389118 1.1352015
row1 1.522046 0.6613189 -0.2634102 0.5389599 -0.7157631 -0.09802196 0.5924684
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row3 1.246825 0.3188683 1.8805439 -0.2596528 0.8559617 0.3244861 1.022529
row1 -1.019168 0.7748975 0.7852945 0.4928304 -0.1134942 0.2207335 1.911162
[,15] [,16] [,17] [,18] [,19] [,20]
row3 -0.8889087 0.3104232 1.860276 3.7060419 1.9633375 -0.7978226
row1 -1.7052049 -2.2267679 -1.425424 -0.1620565 -0.9021485 0.4902193
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.5810164 -0.4620421 0.2024094 -0.8663218 0.2826417 0.02589725 1.034475
[,8] [,9] [,10]
row2 -1.37538 1.164706 0.5062004
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 0.7748725 -0.5033753 -0.155367 -0.6167817 -0.8296369 1.894734 -2.78596
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 2.254195 2.478926 -0.1076103 0.5726615 1.373498 -0.9918255 1.318777
[,15] [,16] [,17] [,18] [,19] [,20]
row5 0.5992298 -0.7019633 1.562817 0.9429919 1.076952 -0.5026449
>
>
> 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: 0x3fb017a0>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de01beb2a99"
[2] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de017e7f90d"
[3] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de0434f5afa"
[4] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de06590d25b"
[5] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de02353685c"
[6] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de0579b836e"
[7] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de05960f51e"
[8] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de021d963d9"
[9] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de0267beeb4"
[10] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de0249b53e4"
[11] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de038cc4fab"
[12] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de02a19bd68"
[13] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de028934c50"
[14] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de014bd9bf0"
[15] "/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests/BM3c6de02fda6b2b"
>
>
> ### 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: 0x3dcb8c00>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x3dcb8c00>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.24-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x3dcb8c00>
> rowMedians(tmp)
[1] 0.237937071 -0.722983210 -0.179932164 -0.042821203 -0.030731051
[6] 0.391156317 -0.384835513 0.091831765 0.060103413 0.365565060
[11] 0.090711877 -0.074774829 0.091664721 0.060752218 -1.059668056
[16] 0.165383683 0.233653947 0.375446957 -0.132515377 0.362813709
[21] -0.717630252 -0.218904586 0.406473489 -0.048136288 -0.378739874
[26] 0.325739377 0.526307528 -0.414770988 0.049133198 -0.169447922
[31] 0.554873278 0.124476550 -0.177505438 -0.066606207 0.536791979
[36] -0.060245542 0.332150390 0.310704749 -0.460489555 -0.053351537
[41] -0.186642903 -0.404614924 0.431464508 -0.224249102 0.554495760
[46] -0.400244957 -0.146754331 -0.237967424 0.054281610 -0.237013073
[51] -0.580676434 0.046687367 0.533046241 -0.672379312 0.319288299
[56] -0.385582607 -0.041005759 0.177017268 0.062406903 -0.365421295
[61] -0.570302428 -0.268310435 0.105331261 0.309780241 0.239102525
[66] -0.603044384 -0.117314269 -0.550705796 -0.521697410 -0.663209478
[71] -0.227217149 0.166638666 -0.016298353 -0.273135221 0.091631529
[76] 0.194923081 -0.623356479 0.035747325 0.115567956 0.268407444
[81] 0.267127184 -0.691475800 0.012496859 0.340739124 -0.404934290
[86] 0.691245796 0.083886503 -0.694812141 -0.406469634 -0.298309366
[91] -0.305788443 0.221303498 -0.453218891 0.699677422 -0.243053691
[96] -0.079955291 0.345146345 0.222509690 0.895085713 0.101594020
[101] -0.296414287 -0.345204534 0.005935110 -0.007581276 -0.109396132
[106] 0.428031175 0.051396781 0.122804876 0.433668201 -0.448348775
[111] 0.265482882 0.284902151 -0.108839928 0.415702360 -0.410811437
[116] 0.007392018 0.353258282 0.212592655 -0.134556278 -0.103161545
[121] -0.117124384 0.152887455 0.137076381 0.138487905 -0.127722187
[126] 0.190927712 -0.096237200 0.197473377 -0.491745073 0.332450314
[131] 0.091226220 -0.009384054 0.201595035 0.225666673 -0.346242050
[136] -0.455184587 0.054144435 -0.025979969 -0.503793930 0.403867236
[141] 0.042611860 -0.022971129 0.253017400 -0.301287608 -0.094210407
[146] -0.232960030 0.062326310 0.703691928 -0.095291545 -0.232488851
[151] 0.102482123 -0.215322652 0.137704562 0.256699714 0.348368721
[156] 0.283482108 0.033126499 0.398597249 0.190263315 0.242779111
[161] -0.040441168 0.502503318 0.246241689 -0.238941660 -0.215811219
[166] 0.132232818 -0.182980826 0.194294515 0.274092276 0.176033002
[171] -0.333416084 0.397004651 -0.013882849 -0.066642746 0.357088117
[176] 0.064559018 -0.327202462 -0.026361423 -0.430178319 0.002776711
[181] 0.022643356 -0.075600423 0.375457911 -0.121607221 0.103463999
[186] 0.241471303 -0.223504592 -0.459189032 0.210043722 0.376499755
[191] 0.086402850 -0.131603463 -0.451082109 -0.178619018 0.132232521
[196] 0.272418972 0.311802393 -0.269082011 0.296968474 0.321700496
[201] -0.111642336 -0.047864138 -0.116334444 -0.232787336 0.032480863
[206] 0.389439151 0.110047174 0.074434880 -0.258057776 0.213980373
[211] -0.856030771 -0.068938002 -0.511894868 0.020873659 0.233015402
[216] -0.311933644 0.777193947 -0.323853533 0.067507304 0.406543905
[221] 0.574916559 -0.248449781 0.344452041 -0.011628379 0.019085945
[226] 0.095627552 0.853615849 -0.546348877 0.651802178 -0.397258104
>
> proc.time()
user system elapsed
1.878 0.938 2.841
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.5.0 (2025-04-11) -- "How About a Twenty-Six"
Copyright (C) 2025 The R Foundation for Statistical Computing
Platform: aarch64-unknown-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BufferedMatrix);library.dynam("BufferedMatrix","BufferedMatrix", .libPaths());
Attaching package: 'BufferedMatrix'
The following objects are masked from 'package:base':
colMeans, colSums, rowMeans, rowSums
>
> prefix <- "dbmtest"
> directory <- getwd()
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_Test_C",P)
RBufferedMatrix
Checking dimensions
Rows: 5
Cols: 5
Buffer Rows: 1
Buffer Cols: 1
Assigning Values
0.000000 1.000000 2.000000 3.000000 4.000000
1.000000 2.000000 3.000000 4.000000 5.000000
2.000000 3.000000 4.000000 5.000000 6.000000
3.000000 4.000000 5.000000 6.000000 7.000000
4.000000 5.000000 6.000000 7.000000 8.000000
<pointer: 0x16f74470>
> .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: 0x16f74470>
> .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: 0x16f74470>
> .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: 0x16f74470>
> 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: 0x16f4f0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x16f4f0e0>
> .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: 0x16f4f0e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x16f4f0e0>
> .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: 0x16f4f0e0>
> 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: 0x15ed6520>
> .Call("R_bm_AddColumn",P)
<pointer: 0x15ed6520>
> .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: 0x15ed6520>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x15ed6520>
> .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: 0x15ed6520>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x15ed6520>
> .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: 0x15ed6520>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x15ed6520>
> .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: 0x15ed6520>
> 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: 0x1617e040>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x1617e040>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1617e040>
> .Call("R_bm_AddColumn",P)
<pointer: 0x1617e040>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c6df3655f96ff" "BufferedMatrixFile3c6df377463c55"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile3c6df3655f96ff" "BufferedMatrixFile3c6df377463c55"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x18299990>
> .Call("R_bm_AddColumn",P)
<pointer: 0x18299990>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x18299990>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x18299990>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x18299990>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x18299990>
> .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: 0x166fe960>
> .Call("R_bm_AddColumn",P)
<pointer: 0x166fe960>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x166fe960>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x166fe960>
> 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: 0x17c0e220>
> .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: 0x17c0e220>
> rm(P)
>
> proc.time()
user system elapsed
0.341 0.028 0.356
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.346 0.032 0.363