| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-05-05 11:36 -0400 (Tue, 05 May 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) | x86_64 | 4.6.0 RC (2026-04-17 r89917) -- "Because it was There" | 4989 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | 4.6.0 Patched (2026-04-24 r89963) -- "Because it was There" | 4719 |
| 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 262/2418 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.76.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.4 LTS) / x86_64 | OK | OK | OK | |||||||||
| kjohnson3 | macOS 13.7.7 Ventura / arm64 | OK | OK | WARNINGS | 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. |
| Package: BufferedMatrix |
| Version: 1.76.0 |
| Command: /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz |
| StartedAt: 2026-05-04 22:05:36 -0400 (Mon, 04 May 2026) |
| EndedAt: 2026-05-04 22:06:02 -0400 (Mon, 04 May 2026) |
| EllapsedTime: 25.1 seconds |
| RetCode: 0 |
| Status: OK |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 0 |
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/home/biocbuild/bbs-3.23-bioc/R/site-library --timings BufferedMatrix_1.76.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R version 4.6.0 RC (2026-04-17 r89917)
* using platform: x86_64-pc-linux-gnu
* R was compiled by
gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
GNU Fortran (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0
* running under: Ubuntu 24.04.4 LTS
* using session charset: UTF-8
* current time: 2026-05-05 02:05:37 UTC
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.76.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: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.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 ... INFO
Note: information on .o files is not available
* checking sizes of PDF files under ‘inst/doc’ ...* 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 re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 NOTE
See
‘/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /home/biocbuild/bbs-3.23-bioc/R/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/home/biocbuild/bbs-3.23-bioc/R/site-library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.76.0’
** using staged installation
** libs
using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04.1) 13.3.0’
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c RBufferedMatrix.c -o RBufferedMatrix.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c: In function ‘dbm_ReadOnlyMode’:
doubleBufferedMatrix.c:1580:7: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’ [-Wparentheses]
1580 | if (!(Matrix->readonly) & setting){
| ^~~~~~~~~~~~~~~~~~~
doubleBufferedMatrix.c: At top level:
doubleBufferedMatrix.c:3327:12: warning: ‘sort_double’ defined but not used [-Wunused-function]
3327 | static int sort_double(const double *a1,const double *a2){
| ^~~~~~~~~~~
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
gcc -std=gnu2x -I"/home/biocbuild/bbs-3.23-bioc/R/include" -DNDEBUG -I/usr/local/include -fpic -g -O2 -Wall -Werror=format-security -c init_package.c -o init_package.o
gcc -std=gnu2x -shared -L/home/biocbuild/bbs-3.23-bioc/R/lib -L/usr/local/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -L/home/biocbuild/bbs-3.23-bioc/R/lib -lR
installing to /home/biocbuild/bbs-3.23-bioc/R/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.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.252 0.050 0.292
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.23-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 480233 25.7 1053308 56.3 637571 34.1
Vcells 887253 6.8 8388608 64.0 2083896 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] "Mon May 4 22:05:52 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] "Mon May 4 22:05:52 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: 0x56ca71dd5690>
>
>
>
> 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] "Mon May 4 22:05:53 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] "Mon May 4 22:05:53 2026"
>
> ColMode(tmp2)
<pointer: 0x56ca71dd5690>
>
>
>
> ### Now testing assignments
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,1)
+
+ new.data <- rnorm(20)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,] <- new.data
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,1)
+ new.data <- rnorm(10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[,which.col] <- new.data
+ test.matrix[,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[,prev.col] == test.matrix[,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.col <- which.col
+ }
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ new.data <- matrix(rnorm(50),5,10)
+ tmp2[which.row,] <- new.data
+ test.matrix[which.row,]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,] == test.matrix[prev.row,])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ }
>
>
>
>
>
> for (rep in 1:nreps){
+ which.row <- sample(1:10,5,replace=TRUE)
+ which.col <- sample(1:20,5,replace=TRUE)
+ new.data <- matrix(rnorm(25),5,5)
+ tmp2[which.row,which.col] <- new.data
+ test.matrix[which.row,which.col]<- new.data
+
+ if (rep > 1){
+ if (!all(tmp2[prev.row,prev.col] == test.matrix[prev.row,prev.col])){
+ cat("incorrect agreement")
+ break;
+ }
+ }
+ prev.row <- which.row
+ prev.col <- which.col
+ }
>
>
>
>
> ###
> ###
> ### testing some more functions
> ###
>
>
>
> ## duplication function
> tmp5 <- duplicate(tmp2)
>
> # making sure really did copy everything.
> tmp5[1,1] <- tmp5[1,1] +100.00
>
> if (tmp5[1,1] == tmp2[1,1]){
+ stop("Problem with duplication")
+ }
>
>
>
>
> ### testing elementwise applying of functions
>
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 98.89531514 -0.5308992 -0.3435707 1.297246
[2,] 0.04333506 0.3464555 0.3015438 1.053921
[3,] -0.32250571 0.1624917 -0.5318796 -1.453047
[4,] 0.48874922 2.4946963 1.5224824 -1.893043
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 98.89531514 0.5308992 0.3435707 1.297246
[2,] 0.04333506 0.3464555 0.3015438 1.053921
[3,] 0.32250571 0.1624917 0.5318796 1.453047
[4,] 0.48874922 2.4946963 1.5224824 1.893043
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9446124 0.7286283 0.5861490 1.138967
[2,] 0.2081707 0.5886047 0.5491300 1.026606
[3,] 0.5678959 0.4031026 0.7293007 1.205424
[4,] 0.6991060 1.5794607 1.2338891 1.375879
>
> 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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 2 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 223.34144 32.81718 31.20506 37.68692
[2,] 27.12504 31.23250 30.79284 36.31998
[3,] 31.00146 29.19352 32.82489 38.50729
[4,] 32.47981 43.28930 38.86137 40.65183
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x56ca731890c0>
> exp(tmp5)
<pointer: 0x56ca731890c0>
> log(tmp5,2)
<pointer: 0x56ca731890c0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 464.8559
> Min(tmp5)
[1] 53.85398
> mean(tmp5)
[1] 72.5929
> Sum(tmp5)
[1] 14518.58
> Var(tmp5)
[1] 850.5385
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 91.30258 70.58310 70.50903 71.32310 70.22537 66.56489 73.95561 69.45085
[9] 72.41902 69.59542
> rowSums(tmp5)
[1] 1826.052 1411.662 1410.181 1426.462 1404.507 1331.298 1479.112 1389.017
[9] 1448.380 1391.908
> rowVars(tmp5)
[1] 7801.79237 72.58118 96.89836 86.55291 120.14148 42.26394
[7] 52.11596 40.05249 82.45497 68.43518
> rowSd(tmp5)
[1] 88.327755 8.519459 9.843696 9.303382 10.960907 6.501072 7.219139
[8] 6.328703 9.080472 8.272556
> rowMax(tmp5)
[1] 464.85594 81.67540 94.49261 90.10101 90.71853 77.02239 88.46821
[8] 81.56819 91.20317 83.97555
> rowMin(tmp5)
[1] 54.51104 56.45722 55.70417 57.38396 53.85398 54.11602 65.96482 57.83749
[9] 54.75801 54.36524
>
> colMeans(tmp5)
[1] 105.50260 68.64454 68.60550 74.23210 67.21849 68.46887 71.80632
[8] 66.72091 71.20599 68.97127 70.25893 74.33960 69.95450 72.01551
[15] 74.17216 74.11363 71.66061 72.53801 68.33952 73.08886
> colSums(tmp5)
[1] 1055.0260 686.4454 686.0550 742.3210 672.1849 684.6887 718.0632
[8] 667.2091 712.0599 689.7127 702.5893 743.3960 699.5450 720.1551
[15] 741.7216 741.1363 716.6061 725.3801 683.3952 730.8886
> colVars(tmp5)
[1] 15963.54829 78.76342 39.12556 52.70252 82.87330 92.87523
[7] 31.98536 123.50249 160.75968 77.89913 45.92069 127.89295
[13] 61.10441 35.74697 76.05934 104.50888 59.53777 73.04770
[19] 52.57878 73.62486
> colSd(tmp5)
[1] 126.346936 8.874876 6.255043 7.259650 9.103477 9.637180
[7] 5.655560 11.113168 12.679104 8.826048 6.776481 11.308976
[13] 7.816931 5.978877 8.721201 10.222959 7.716072 8.546795
[19] 7.251123 8.580493
> colMax(tmp5)
[1] 464.85594 90.10101 80.88486 84.61146 83.97555 83.73038 79.64886
[8] 84.61556 94.49261 79.36100 85.09943 91.20317 82.48143 82.84884
[15] 88.46821 90.71853 85.30661 88.94487 81.58212 86.78108
> colMin(tmp5)
[1] 56.45722 60.76248 61.63317 62.84749 53.85398 57.38396 64.56421 54.11602
[9] 57.95759 54.51104 60.87355 57.95843 60.40780 62.04092 59.35563 54.36524
[17] 58.09677 58.72013 55.96429 58.65006
>
>
> ### 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] 91.30258 70.58310 70.50903 71.32310 NA 66.56489 73.95561 69.45085
[9] 72.41902 69.59542
> rowSums(tmp5)
[1] 1826.052 1411.662 1410.181 1426.462 NA 1331.298 1479.112 1389.017
[9] 1448.380 1391.908
> rowVars(tmp5)
[1] 7801.79237 72.58118 96.89836 86.55291 102.25637 42.26394
[7] 52.11596 40.05249 82.45497 68.43518
> rowSd(tmp5)
[1] 88.327755 8.519459 9.843696 9.303382 10.112189 6.501072 7.219139
[8] 6.328703 9.080472 8.272556
> rowMax(tmp5)
[1] 464.85594 81.67540 94.49261 90.10101 NA 77.02239 88.46821
[8] 81.56819 91.20317 83.97555
> rowMin(tmp5)
[1] 54.51104 56.45722 55.70417 57.38396 NA 54.11602 65.96482 57.83749
[9] 54.75801 54.36524
>
> colMeans(tmp5)
[1] 105.50260 68.64454 68.60550 74.23210 67.21849 68.46887 71.80632
[8] 66.72091 71.20599 68.97127 70.25893 74.33960 69.95450 72.01551
[15] 74.17216 NA 71.66061 72.53801 68.33952 73.08886
> colSums(tmp5)
[1] 1055.0260 686.4454 686.0550 742.3210 672.1849 684.6887 718.0632
[8] 667.2091 712.0599 689.7127 702.5893 743.3960 699.5450 720.1551
[15] 741.7216 NA 716.6061 725.3801 683.3952 730.8886
> colVars(tmp5)
[1] 15963.54829 78.76342 39.12556 52.70252 82.87330 92.87523
[7] 31.98536 123.50249 160.75968 77.89913 45.92069 127.89295
[13] 61.10441 35.74697 76.05934 NA 59.53777 73.04770
[19] 52.57878 73.62486
> colSd(tmp5)
[1] 126.346936 8.874876 6.255043 7.259650 9.103477 9.637180
[7] 5.655560 11.113168 12.679104 8.826048 6.776481 11.308976
[13] 7.816931 5.978877 8.721201 NA 7.716072 8.546795
[19] 7.251123 8.580493
> colMax(tmp5)
[1] 464.85594 90.10101 80.88486 84.61146 83.97555 83.73038 79.64886
[8] 84.61556 94.49261 79.36100 85.09943 91.20317 82.48143 82.84884
[15] 88.46821 NA 85.30661 88.94487 81.58212 86.78108
> colMin(tmp5)
[1] 56.45722 60.76248 61.63317 62.84749 53.85398 57.38396 64.56421 54.11602
[9] 57.95759 54.51104 60.87355 57.95843 60.40780 62.04092 59.35563 NA
[17] 58.09677 58.72013 55.96429 58.65006
>
> Max(tmp5,na.rm=TRUE)
[1] 464.8559
> Min(tmp5,na.rm=TRUE)
[1] 53.85398
> mean(tmp5,na.rm=TRUE)
[1] 72.50181
> Sum(tmp5,na.rm=TRUE)
[1] 14427.86
> Var(tmp5,na.rm=TRUE)
[1] 853.1665
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.30258 70.58310 70.50903 71.32310 69.14678 66.56489 73.95561 69.45085
[9] 72.41902 69.59542
> rowSums(tmp5,na.rm=TRUE)
[1] 1826.052 1411.662 1410.181 1426.462 1313.789 1331.298 1479.112 1389.017
[9] 1448.380 1391.908
> rowVars(tmp5,na.rm=TRUE)
[1] 7801.79237 72.58118 96.89836 86.55291 102.25637 42.26394
[7] 52.11596 40.05249 82.45497 68.43518
> rowSd(tmp5,na.rm=TRUE)
[1] 88.327755 8.519459 9.843696 9.303382 10.112189 6.501072 7.219139
[8] 6.328703 9.080472 8.272556
> rowMax(tmp5,na.rm=TRUE)
[1] 464.85594 81.67540 94.49261 90.10101 86.78108 77.02239 88.46821
[8] 81.56819 91.20317 83.97555
> rowMin(tmp5,na.rm=TRUE)
[1] 54.51104 56.45722 55.70417 57.38396 53.85398 54.11602 65.96482 57.83749
[9] 54.75801 54.36524
>
> colMeans(tmp5,na.rm=TRUE)
[1] 105.50260 68.64454 68.60550 74.23210 67.21849 68.46887 71.80632
[8] 66.72091 71.20599 68.97127 70.25893 74.33960 69.95450 72.01551
[15] 74.17216 72.26864 71.66061 72.53801 68.33952 73.08886
> colSums(tmp5,na.rm=TRUE)
[1] 1055.0260 686.4454 686.0550 742.3210 672.1849 684.6887 718.0632
[8] 667.2091 712.0599 689.7127 702.5893 743.3960 699.5450 720.1551
[15] 741.7216 650.4177 716.6061 725.3801 683.3952 730.8886
> colVars(tmp5,na.rm=TRUE)
[1] 15963.54829 78.76342 39.12556 52.70252 82.87330 92.87523
[7] 31.98536 123.50249 160.75968 77.89913 45.92069 127.89295
[13] 61.10441 35.74697 76.05934 79.27767 59.53777 73.04770
[19] 52.57878 73.62486
> colSd(tmp5,na.rm=TRUE)
[1] 126.346936 8.874876 6.255043 7.259650 9.103477 9.637180
[7] 5.655560 11.113168 12.679104 8.826048 6.776481 11.308976
[13] 7.816931 5.978877 8.721201 8.903801 7.716072 8.546795
[19] 7.251123 8.580493
> colMax(tmp5,na.rm=TRUE)
[1] 464.85594 90.10101 80.88486 84.61146 83.97555 83.73038 79.64886
[8] 84.61556 94.49261 79.36100 85.09943 91.20317 82.48143 82.84884
[15] 88.46821 84.53275 85.30661 88.94487 81.58212 86.78108
> colMin(tmp5,na.rm=TRUE)
[1] 56.45722 60.76248 61.63317 62.84749 53.85398 57.38396 64.56421 54.11602
[9] 57.95759 54.51104 60.87355 57.95843 60.40780 62.04092 59.35563 54.36524
[17] 58.09677 58.72013 55.96429 58.65006
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 91.30258 70.58310 70.50903 71.32310 NaN 66.56489 73.95561 69.45085
[9] 72.41902 69.59542
> rowSums(tmp5,na.rm=TRUE)
[1] 1826.052 1411.662 1410.181 1426.462 0.000 1331.298 1479.112 1389.017
[9] 1448.380 1391.908
> rowVars(tmp5,na.rm=TRUE)
[1] 7801.79237 72.58118 96.89836 86.55291 NA 42.26394
[7] 52.11596 40.05249 82.45497 68.43518
> rowSd(tmp5,na.rm=TRUE)
[1] 88.327755 8.519459 9.843696 9.303382 NA 6.501072 7.219139
[8] 6.328703 9.080472 8.272556
> rowMax(tmp5,na.rm=TRUE)
[1] 464.85594 81.67540 94.49261 90.10101 NA 77.02239 88.46821
[8] 81.56819 91.20317 83.97555
> rowMin(tmp5,na.rm=TRUE)
[1] 54.51104 56.45722 55.70417 57.38396 NA 54.11602 65.96482 57.83749
[9] 54.75801 54.36524
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 109.88268 67.70538 69.38020 74.81183 68.70344 66.77315 71.27853
[8] 67.38147 72.67421 70.38321 69.73238 75.55181 70.06408 72.87122
[15] 73.16219 NaN 73.16771 71.67338 68.08610 71.56751
> colSums(tmp5,na.rm=TRUE)
[1] 988.9441 609.3484 624.4218 673.3064 618.3310 600.9584 641.5068 606.4332
[9] 654.0679 633.4489 627.5914 679.9663 630.5767 655.8410 658.4597 0.0000
[17] 658.5093 645.0605 612.7749 644.1076
> colVars(tmp5,na.rm=TRUE)
[1] 17743.15899 78.68610 37.26439 55.50938 68.42548 72.13553
[7] 32.84975 134.03155 156.60344 65.20892 48.54166 127.34830
[13] 68.60737 31.97757 74.09127 NA 41.42751 73.76832
[19] 58.42864 56.78954
> colSd(tmp5,na.rm=TRUE)
[1] 133.203450 8.870518 6.104457 7.450462 8.271969 8.493264
[7] 5.731470 11.577200 12.514130 8.075204 6.967184 11.284870
[13] 8.282957 5.654871 8.607629 NA 6.436421 8.588848
[19] 7.643863 7.535884
> colMax(tmp5,na.rm=TRUE)
[1] 464.85594 90.10101 80.88486 84.61146 83.97555 83.58955 79.64886
[8] 84.61556 94.49261 79.36100 85.09943 91.20317 82.48143 82.84884
[15] 88.46821 -Inf 85.30661 88.94487 81.58212 81.67540
> colMin(tmp5,na.rm=TRUE)
[1] 56.45722 60.76248 64.09127 62.84749 54.75801 57.38396 64.56421 54.11602
[9] 57.95759 54.51104 60.87355 57.95843 60.40780 62.04092 59.35563 Inf
[17] 64.81738 58.72013 55.96429 58.65006
>
>
>
>
> 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] 144.9907 387.2026 173.9773 288.3466 171.6942 271.6296 309.0603 125.1908
[9] 175.8313 296.1782
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 144.9907 387.2026 173.9773 288.3466 171.6942 271.6296 309.0603 125.1908
[9] 175.8313 296.1782
>
>
>
> 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.273737e-13 0.000000e+00 0.000000e+00 -5.684342e-14 1.989520e-13
[6] -8.526513e-14 -3.126388e-13 -1.136868e-13 -1.136868e-13 1.136868e-13
[11] 1.705303e-13 4.263256e-14 0.000000e+00 5.684342e-14 -8.526513e-14
[16] -8.526513e-14 0.000000e+00 -2.842171e-14 2.842171e-14 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)
+ }
5 7
4 10
4 9
9 5
7 2
1 20
9 7
4 13
6 8
1 10
9 20
7 4
10 5
3 11
1 12
1 13
7 16
5 4
2 2
10 12
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.472722
> Min(tmp)
[1] -2.757015
> mean(tmp)
[1] -0.05008929
> Sum(tmp)
[1] -5.008929
> Var(tmp)
[1] 0.9693402
>
> rowMeans(tmp)
[1] -0.05008929
> rowSums(tmp)
[1] -5.008929
> rowVars(tmp)
[1] 0.9693402
> rowSd(tmp)
[1] 0.9845507
> rowMax(tmp)
[1] 2.472722
> rowMin(tmp)
[1] -2.757015
>
> colMeans(tmp)
[1] -0.98281968 -0.96427667 0.15003539 -2.75701525 -0.17994642 0.10373723
[7] 1.34264209 -0.93348285 0.53623527 1.18557934 1.12393040 0.18241150
[13] -0.98563039 1.06187569 -1.88596455 -0.94109720 0.14813224 -0.54239646
[19] -0.43515139 -0.86319872 0.40303493 0.84900151 0.84154469 -0.93989666
[25] -0.42262994 -0.71992149 2.09692594 0.56185222 0.92541481 -1.43824862
[31] 0.65876392 0.80141719 -0.37788068 0.50187179 1.02117822 -0.22258802
[37] -0.20836947 0.93820119 1.41142744 -0.78561818 1.28714802 0.18460148
[43] -0.59457973 0.64571927 -0.16584681 0.27789822 -0.83461904 1.24817198
[49] 0.80531748 -0.60407611 -0.47709569 0.06152087 -0.02470047 0.55419872
[55] 0.05914459 1.01030390 0.29522342 -0.40720625 -1.60990719 0.21786900
[61] -0.93556561 1.74610553 -0.57632166 2.01549648 1.06670400 -1.45952761
[67] 0.22751877 -1.24089957 -0.16368879 -1.22037938 0.91611380 -0.64190499
[73] 0.24519104 -1.09896157 -0.07305008 -0.79046966 2.47272227 -0.94339676
[79] 1.04911732 0.40894698 -1.50957553 -0.88251788 -0.06735661 0.20597531
[85] -1.79925948 0.27905304 0.83501296 -0.83827579 -0.65034320 -0.01981802
[91] -0.03074963 -0.56147972 -2.52907849 -1.30249965 0.90130117 -0.08825652
[97] 0.10961355 1.16799994 -0.59103352 -0.82955716
> colSums(tmp)
[1] -0.98281968 -0.96427667 0.15003539 -2.75701525 -0.17994642 0.10373723
[7] 1.34264209 -0.93348285 0.53623527 1.18557934 1.12393040 0.18241150
[13] -0.98563039 1.06187569 -1.88596455 -0.94109720 0.14813224 -0.54239646
[19] -0.43515139 -0.86319872 0.40303493 0.84900151 0.84154469 -0.93989666
[25] -0.42262994 -0.71992149 2.09692594 0.56185222 0.92541481 -1.43824862
[31] 0.65876392 0.80141719 -0.37788068 0.50187179 1.02117822 -0.22258802
[37] -0.20836947 0.93820119 1.41142744 -0.78561818 1.28714802 0.18460148
[43] -0.59457973 0.64571927 -0.16584681 0.27789822 -0.83461904 1.24817198
[49] 0.80531748 -0.60407611 -0.47709569 0.06152087 -0.02470047 0.55419872
[55] 0.05914459 1.01030390 0.29522342 -0.40720625 -1.60990719 0.21786900
[61] -0.93556561 1.74610553 -0.57632166 2.01549648 1.06670400 -1.45952761
[67] 0.22751877 -1.24089957 -0.16368879 -1.22037938 0.91611380 -0.64190499
[73] 0.24519104 -1.09896157 -0.07305008 -0.79046966 2.47272227 -0.94339676
[79] 1.04911732 0.40894698 -1.50957553 -0.88251788 -0.06735661 0.20597531
[85] -1.79925948 0.27905304 0.83501296 -0.83827579 -0.65034320 -0.01981802
[91] -0.03074963 -0.56147972 -2.52907849 -1.30249965 0.90130117 -0.08825652
[97] 0.10961355 1.16799994 -0.59103352 -0.82955716
> 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.98281968 -0.96427667 0.15003539 -2.75701525 -0.17994642 0.10373723
[7] 1.34264209 -0.93348285 0.53623527 1.18557934 1.12393040 0.18241150
[13] -0.98563039 1.06187569 -1.88596455 -0.94109720 0.14813224 -0.54239646
[19] -0.43515139 -0.86319872 0.40303493 0.84900151 0.84154469 -0.93989666
[25] -0.42262994 -0.71992149 2.09692594 0.56185222 0.92541481 -1.43824862
[31] 0.65876392 0.80141719 -0.37788068 0.50187179 1.02117822 -0.22258802
[37] -0.20836947 0.93820119 1.41142744 -0.78561818 1.28714802 0.18460148
[43] -0.59457973 0.64571927 -0.16584681 0.27789822 -0.83461904 1.24817198
[49] 0.80531748 -0.60407611 -0.47709569 0.06152087 -0.02470047 0.55419872
[55] 0.05914459 1.01030390 0.29522342 -0.40720625 -1.60990719 0.21786900
[61] -0.93556561 1.74610553 -0.57632166 2.01549648 1.06670400 -1.45952761
[67] 0.22751877 -1.24089957 -0.16368879 -1.22037938 0.91611380 -0.64190499
[73] 0.24519104 -1.09896157 -0.07305008 -0.79046966 2.47272227 -0.94339676
[79] 1.04911732 0.40894698 -1.50957553 -0.88251788 -0.06735661 0.20597531
[85] -1.79925948 0.27905304 0.83501296 -0.83827579 -0.65034320 -0.01981802
[91] -0.03074963 -0.56147972 -2.52907849 -1.30249965 0.90130117 -0.08825652
[97] 0.10961355 1.16799994 -0.59103352 -0.82955716
> colMin(tmp)
[1] -0.98281968 -0.96427667 0.15003539 -2.75701525 -0.17994642 0.10373723
[7] 1.34264209 -0.93348285 0.53623527 1.18557934 1.12393040 0.18241150
[13] -0.98563039 1.06187569 -1.88596455 -0.94109720 0.14813224 -0.54239646
[19] -0.43515139 -0.86319872 0.40303493 0.84900151 0.84154469 -0.93989666
[25] -0.42262994 -0.71992149 2.09692594 0.56185222 0.92541481 -1.43824862
[31] 0.65876392 0.80141719 -0.37788068 0.50187179 1.02117822 -0.22258802
[37] -0.20836947 0.93820119 1.41142744 -0.78561818 1.28714802 0.18460148
[43] -0.59457973 0.64571927 -0.16584681 0.27789822 -0.83461904 1.24817198
[49] 0.80531748 -0.60407611 -0.47709569 0.06152087 -0.02470047 0.55419872
[55] 0.05914459 1.01030390 0.29522342 -0.40720625 -1.60990719 0.21786900
[61] -0.93556561 1.74610553 -0.57632166 2.01549648 1.06670400 -1.45952761
[67] 0.22751877 -1.24089957 -0.16368879 -1.22037938 0.91611380 -0.64190499
[73] 0.24519104 -1.09896157 -0.07305008 -0.79046966 2.47272227 -0.94339676
[79] 1.04911732 0.40894698 -1.50957553 -0.88251788 -0.06735661 0.20597531
[85] -1.79925948 0.27905304 0.83501296 -0.83827579 -0.65034320 -0.01981802
[91] -0.03074963 -0.56147972 -2.52907849 -1.30249965 0.90130117 -0.08825652
[97] 0.10961355 1.16799994 -0.59103352 -0.82955716
> colMedians(tmp)
[1] -0.98281968 -0.96427667 0.15003539 -2.75701525 -0.17994642 0.10373723
[7] 1.34264209 -0.93348285 0.53623527 1.18557934 1.12393040 0.18241150
[13] -0.98563039 1.06187569 -1.88596455 -0.94109720 0.14813224 -0.54239646
[19] -0.43515139 -0.86319872 0.40303493 0.84900151 0.84154469 -0.93989666
[25] -0.42262994 -0.71992149 2.09692594 0.56185222 0.92541481 -1.43824862
[31] 0.65876392 0.80141719 -0.37788068 0.50187179 1.02117822 -0.22258802
[37] -0.20836947 0.93820119 1.41142744 -0.78561818 1.28714802 0.18460148
[43] -0.59457973 0.64571927 -0.16584681 0.27789822 -0.83461904 1.24817198
[49] 0.80531748 -0.60407611 -0.47709569 0.06152087 -0.02470047 0.55419872
[55] 0.05914459 1.01030390 0.29522342 -0.40720625 -1.60990719 0.21786900
[61] -0.93556561 1.74610553 -0.57632166 2.01549648 1.06670400 -1.45952761
[67] 0.22751877 -1.24089957 -0.16368879 -1.22037938 0.91611380 -0.64190499
[73] 0.24519104 -1.09896157 -0.07305008 -0.79046966 2.47272227 -0.94339676
[79] 1.04911732 0.40894698 -1.50957553 -0.88251788 -0.06735661 0.20597531
[85] -1.79925948 0.27905304 0.83501296 -0.83827579 -0.65034320 -0.01981802
[91] -0.03074963 -0.56147972 -2.52907849 -1.30249965 0.90130117 -0.08825652
[97] 0.10961355 1.16799994 -0.59103352 -0.82955716
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] -0.9828197 -0.9642767 0.1500354 -2.757015 -0.1799464 0.1037372 1.342642
[2,] -0.9828197 -0.9642767 0.1500354 -2.757015 -0.1799464 0.1037372 1.342642
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] -0.9334828 0.5362353 1.185579 1.12393 0.1824115 -0.9856304 1.061876
[2,] -0.9334828 0.5362353 1.185579 1.12393 0.1824115 -0.9856304 1.061876
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.885965 -0.9410972 0.1481322 -0.5423965 -0.4351514 -0.8631987 0.4030349
[2,] -1.885965 -0.9410972 0.1481322 -0.5423965 -0.4351514 -0.8631987 0.4030349
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.8490015 0.8415447 -0.9398967 -0.4226299 -0.7199215 2.096926 0.5618522
[2,] 0.8490015 0.8415447 -0.9398967 -0.4226299 -0.7199215 2.096926 0.5618522
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] 0.9254148 -1.438249 0.6587639 0.8014172 -0.3778807 0.5018718 1.021178
[2,] 0.9254148 -1.438249 0.6587639 0.8014172 -0.3778807 0.5018718 1.021178
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] -0.222588 -0.2083695 0.9382012 1.411427 -0.7856182 1.287148 0.1846015
[2,] -0.222588 -0.2083695 0.9382012 1.411427 -0.7856182 1.287148 0.1846015
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -0.5945797 0.6457193 -0.1658468 0.2778982 -0.834619 1.248172 0.8053175
[2,] -0.5945797 0.6457193 -0.1658468 0.2778982 -0.834619 1.248172 0.8053175
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] -0.6040761 -0.4770957 0.06152087 -0.02470047 0.5541987 0.05914459 1.010304
[2,] -0.6040761 -0.4770957 0.06152087 -0.02470047 0.5541987 0.05914459 1.010304
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] 0.2952234 -0.4072063 -1.609907 0.217869 -0.9355656 1.746106 -0.5763217
[2,] 0.2952234 -0.4072063 -1.609907 0.217869 -0.9355656 1.746106 -0.5763217
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] 2.015496 1.066704 -1.459528 0.2275188 -1.2409 -0.1636888 -1.220379
[2,] 2.015496 1.066704 -1.459528 0.2275188 -1.2409 -0.1636888 -1.220379
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 0.9161138 -0.641905 0.245191 -1.098962 -0.07305008 -0.7904697 2.472722
[2,] 0.9161138 -0.641905 0.245191 -1.098962 -0.07305008 -0.7904697 2.472722
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -0.9433968 1.049117 0.408947 -1.509576 -0.8825179 -0.06735661 0.2059753
[2,] -0.9433968 1.049117 0.408947 -1.509576 -0.8825179 -0.06735661 0.2059753
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] -1.799259 0.279053 0.835013 -0.8382758 -0.6503432 -0.01981802 -0.03074963
[2,] -1.799259 0.279053 0.835013 -0.8382758 -0.6503432 -0.01981802 -0.03074963
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] -0.5614797 -2.529078 -1.3025 0.9013012 -0.08825652 0.1096135 1.168
[2,] -0.5614797 -2.529078 -1.3025 0.9013012 -0.08825652 0.1096135 1.168
[,99] [,100]
[1,] -0.5910335 -0.8295572
[2,] -0.5910335 -0.8295572
>
>
> Max(tmp2)
[1] 2.272638
> Min(tmp2)
[1] -2.243576
> mean(tmp2)
[1] -0.01938795
> Sum(tmp2)
[1] -1.938795
> Var(tmp2)
[1] 0.9175532
>
> rowMeans(tmp2)
[1] -0.023880373 0.136265185 0.390295294 -0.548230845 -1.910455377
[6] -1.394217591 -1.062642632 -0.332755854 0.480737934 -1.145997435
[11] 0.607134775 -0.140537260 0.907059777 -0.299344884 0.765722483
[16] -1.588923051 -0.179449098 0.246647799 1.208235380 -0.878257087
[21] -0.469058448 1.570633192 0.046512205 -0.915792145 -0.509942672
[26] -0.079546210 -0.894871451 0.142569089 0.826825357 0.747232100
[31] 1.276953838 0.315593573 -1.048867086 -0.187683763 -2.243576370
[36] 0.136800548 0.332442923 0.034781398 -1.135663656 0.008771261
[41] 0.449988065 -0.651584216 -1.506358957 1.796630607 0.836462738
[46] -0.736357003 1.278124125 -0.095632892 0.941504027 0.747670204
[51] 1.347919023 2.272638202 1.588106092 -0.258685477 1.065129338
[56] 0.031910305 -1.962732117 0.642445081 0.568981513 -0.460981809
[61] 0.156492039 -1.167842393 0.107433529 0.045012616 -1.455771362
[66] -0.481391399 -0.554995908 -0.279963958 -0.124185585 1.460129370
[71] 1.857155520 0.604259180 -1.927527271 0.383651047 1.371856124
[76] 0.876983217 -1.606839305 -0.441184172 0.437698356 0.163295914
[81] -0.112381971 -1.178484540 -0.680893730 1.162678345 0.132037811
[86] 0.596985727 0.734006109 -0.656595180 0.337740488 0.776174247
[91] -0.507433970 1.599875586 0.089700582 -0.341231031 -1.308969199
[96] 0.412099426 -1.164729514 -0.598662949 -1.648011114 -0.093663227
> rowSums(tmp2)
[1] -0.023880373 0.136265185 0.390295294 -0.548230845 -1.910455377
[6] -1.394217591 -1.062642632 -0.332755854 0.480737934 -1.145997435
[11] 0.607134775 -0.140537260 0.907059777 -0.299344884 0.765722483
[16] -1.588923051 -0.179449098 0.246647799 1.208235380 -0.878257087
[21] -0.469058448 1.570633192 0.046512205 -0.915792145 -0.509942672
[26] -0.079546210 -0.894871451 0.142569089 0.826825357 0.747232100
[31] 1.276953838 0.315593573 -1.048867086 -0.187683763 -2.243576370
[36] 0.136800548 0.332442923 0.034781398 -1.135663656 0.008771261
[41] 0.449988065 -0.651584216 -1.506358957 1.796630607 0.836462738
[46] -0.736357003 1.278124125 -0.095632892 0.941504027 0.747670204
[51] 1.347919023 2.272638202 1.588106092 -0.258685477 1.065129338
[56] 0.031910305 -1.962732117 0.642445081 0.568981513 -0.460981809
[61] 0.156492039 -1.167842393 0.107433529 0.045012616 -1.455771362
[66] -0.481391399 -0.554995908 -0.279963958 -0.124185585 1.460129370
[71] 1.857155520 0.604259180 -1.927527271 0.383651047 1.371856124
[76] 0.876983217 -1.606839305 -0.441184172 0.437698356 0.163295914
[81] -0.112381971 -1.178484540 -0.680893730 1.162678345 0.132037811
[86] 0.596985727 0.734006109 -0.656595180 0.337740488 0.776174247
[91] -0.507433970 1.599875586 0.089700582 -0.341231031 -1.308969199
[96] 0.412099426 -1.164729514 -0.598662949 -1.648011114 -0.093663227
> 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.023880373 0.136265185 0.390295294 -0.548230845 -1.910455377
[6] -1.394217591 -1.062642632 -0.332755854 0.480737934 -1.145997435
[11] 0.607134775 -0.140537260 0.907059777 -0.299344884 0.765722483
[16] -1.588923051 -0.179449098 0.246647799 1.208235380 -0.878257087
[21] -0.469058448 1.570633192 0.046512205 -0.915792145 -0.509942672
[26] -0.079546210 -0.894871451 0.142569089 0.826825357 0.747232100
[31] 1.276953838 0.315593573 -1.048867086 -0.187683763 -2.243576370
[36] 0.136800548 0.332442923 0.034781398 -1.135663656 0.008771261
[41] 0.449988065 -0.651584216 -1.506358957 1.796630607 0.836462738
[46] -0.736357003 1.278124125 -0.095632892 0.941504027 0.747670204
[51] 1.347919023 2.272638202 1.588106092 -0.258685477 1.065129338
[56] 0.031910305 -1.962732117 0.642445081 0.568981513 -0.460981809
[61] 0.156492039 -1.167842393 0.107433529 0.045012616 -1.455771362
[66] -0.481391399 -0.554995908 -0.279963958 -0.124185585 1.460129370
[71] 1.857155520 0.604259180 -1.927527271 0.383651047 1.371856124
[76] 0.876983217 -1.606839305 -0.441184172 0.437698356 0.163295914
[81] -0.112381971 -1.178484540 -0.680893730 1.162678345 0.132037811
[86] 0.596985727 0.734006109 -0.656595180 0.337740488 0.776174247
[91] -0.507433970 1.599875586 0.089700582 -0.341231031 -1.308969199
[96] 0.412099426 -1.164729514 -0.598662949 -1.648011114 -0.093663227
> rowMin(tmp2)
[1] -0.023880373 0.136265185 0.390295294 -0.548230845 -1.910455377
[6] -1.394217591 -1.062642632 -0.332755854 0.480737934 -1.145997435
[11] 0.607134775 -0.140537260 0.907059777 -0.299344884 0.765722483
[16] -1.588923051 -0.179449098 0.246647799 1.208235380 -0.878257087
[21] -0.469058448 1.570633192 0.046512205 -0.915792145 -0.509942672
[26] -0.079546210 -0.894871451 0.142569089 0.826825357 0.747232100
[31] 1.276953838 0.315593573 -1.048867086 -0.187683763 -2.243576370
[36] 0.136800548 0.332442923 0.034781398 -1.135663656 0.008771261
[41] 0.449988065 -0.651584216 -1.506358957 1.796630607 0.836462738
[46] -0.736357003 1.278124125 -0.095632892 0.941504027 0.747670204
[51] 1.347919023 2.272638202 1.588106092 -0.258685477 1.065129338
[56] 0.031910305 -1.962732117 0.642445081 0.568981513 -0.460981809
[61] 0.156492039 -1.167842393 0.107433529 0.045012616 -1.455771362
[66] -0.481391399 -0.554995908 -0.279963958 -0.124185585 1.460129370
[71] 1.857155520 0.604259180 -1.927527271 0.383651047 1.371856124
[76] 0.876983217 -1.606839305 -0.441184172 0.437698356 0.163295914
[81] -0.112381971 -1.178484540 -0.680893730 1.162678345 0.132037811
[86] 0.596985727 0.734006109 -0.656595180 0.337740488 0.776174247
[91] -0.507433970 1.599875586 0.089700582 -0.341231031 -1.308969199
[96] 0.412099426 -1.164729514 -0.598662949 -1.648011114 -0.093663227
>
> colMeans(tmp2)
[1] -0.01938795
> colSums(tmp2)
[1] -1.938795
> colVars(tmp2)
[1] 0.9175532
> colSd(tmp2)
[1] 0.95789
> colMax(tmp2)
[1] 2.272638
> colMin(tmp2)
[1] -2.243576
> colMedians(tmp2)
[1] 0.03334585
> colRanges(tmp2)
[,1]
[1,] -2.243576
[2,] 2.272638
>
> 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.11987068 1.32948332 -2.64120583 1.68001349 -5.07281136
[6] -0.02783065 -2.00274399 -2.39697305 1.81252225 -11.27676427
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.0171354
[2,] -0.5630812
[3,] 0.1352953
[4,] 0.7645075
[5,] 1.1563705
>
> rowApply(tmp,sum)
[1] -3.9468594 4.3899152 -2.1791286 -5.7725702 -2.4973404 -2.3207504
[7] -3.2935089 0.5818705 -0.1585735 -2.2794938
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 5 7 3 10 3 9 7 9 8 1
[2,] 4 6 5 6 5 10 10 7 7 7
[3,] 9 1 9 1 4 3 4 8 6 9
[4,] 6 10 6 7 6 6 6 4 3 10
[5,] 10 8 1 3 7 7 5 3 4 4
[6,] 7 4 7 2 8 8 3 6 10 8
[7,] 3 3 8 4 2 1 8 10 1 6
[8,] 8 5 2 8 9 4 2 2 9 5
[9,] 2 9 10 9 10 2 9 5 2 3
[10,] 1 2 4 5 1 5 1 1 5 2
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 2.6530502 1.5941721 -1.8841363 -0.7888630 -0.5766943 0.3176648
[7] -1.7101792 -2.0491656 4.4674794 3.9311192 -0.3309859 2.3932688
[13] 1.6453075 3.1417189 3.8097231 -0.6615807 -1.2879219 2.9241062
[19] 2.7549110 2.4816763
> colApply(tmp,quantile)[,1]
[,1]
[1,] -0.42732479
[2,] -0.07339463
[3,] 0.23004707
[4,] 1.12911838
[5,] 1.79460412
>
> rowApply(tmp,sum)
[1] 12.10250810 5.66803122 3.52241009 0.04209225 1.48962883
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 17 9 9 7 18
[2,] 7 8 17 5 13
[3,] 14 14 3 6 5
[4,] 15 11 15 4 1
[5,] 2 15 7 15 3
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 1.79460412 0.1701158 0.6605516 0.9493970 -0.4687942 2.0284399
[2,] 0.23004707 0.1841628 0.8991903 0.2594608 0.9761976 -0.7718815
[3,] -0.07339463 1.1727845 -1.5776224 0.8910205 -0.4041099 -0.3491464
[4,] -0.42732479 -0.8340543 -0.7617294 -0.8836326 0.7668942 0.8867134
[5,] 1.12911838 0.9011633 -1.1045263 -2.0051088 -1.4468820 -1.4764608
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 0.6244090 0.2471811 1.1792137 -0.02893273 0.1501190 -0.04692659
[2,] 0.2331967 -1.3746252 0.6803334 1.10179158 1.7381074 -1.14127696
[3,] -1.6383366 -0.4990397 1.3209051 2.03011317 -1.6787604 2.17356800
[4,] -1.5390767 -1.3796657 0.9443048 0.77347415 0.4901023 0.39589457
[5,] 0.6096284 0.9569839 0.3427224 0.05467303 -1.0305542 1.01200983
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] 1.96210207 -0.5234300 0.6406367 0.3554358 -0.09379146 1.8481960
[2,] -0.08732819 0.7983517 1.0706004 -0.5691034 -0.90720207 1.0007725
[3,] 0.63368009 0.9730717 0.8487342 0.6246854 -1.31189623 0.4982393
[4,] -1.45362582 0.8772927 0.3474095 0.1226090 -0.10755284 -0.0379343
[5,] 0.59047938 1.0164328 0.9023424 -1.1952075 1.13252067 -0.3851673
[,19] [,20]
[1,] 0.43782864 0.2161527
[2,] 1.57281345 -0.2255771
[3,] -0.52179431 0.4097086
[4,] 0.01760857 1.8443855
[5,] 1.24845464 0.2370066
>
>
> 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.23-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.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 651 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /home/biocbuild/bbs-3.23-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.23-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.7229555 -2.694482 0.4358985 0.7892387 -0.1043725 -0.9421371 1.239387
col8 col9 col10 col11 col12 col13 col14
row1 -1.746031 -0.102837 0.04692343 -1.019966 -0.01370261 1.301238 0.2836393
col15 col16 col17 col18 col19 col20
row1 1.24769 0.4336301 0.2641392 -1.648281 1.029893 -1.037918
> tmp[,"col10"]
col10
row1 0.04692343
row2 1.24323102
row3 0.48884490
row4 0.31731687
row5 -0.35340650
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6
row1 -0.7229555 -2.6944816 0.4358985 0.7892387 -0.1043725 -0.94213709
row5 -0.2631186 -0.2301211 -0.2414829 1.9713610 -0.1035243 0.08562033
col7 col8 col9 col10 col11 col12
row1 1.23938716 -1.7460312 -0.1028370 0.04692343 -1.0199656 -0.01370261
row5 0.09349562 -0.3556494 0.7726943 -0.35340650 -0.6026151 -1.11431342
col13 col14 col15 col16 col17 col18 col19
row1 1.301238 0.2836393 1.2476895 0.43363009 0.2641392 -1.648281 1.0298928
row5 0.330200 -2.2229859 -0.5732922 0.04332685 -0.5027877 1.065123 0.5664783
col20
row1 -1.0379179
row5 -0.1536908
> tmp[,c("col6","col20")]
col6 col20
row1 -0.94213709 -1.0379179
row2 1.66377704 1.5741413
row3 0.36424523 -0.4130590
row4 0.75934131 0.4352675
row5 0.08562033 -0.1536908
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.94213709 -1.0379179
row5 0.08562033 -0.1536908
>
>
>
>
> 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.69773 48.78552 49.29037 50.68511 49.39976 102.8972 48.69186 51.5751
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.76782 50.13104 51.47118 50.13092 49.07401 50.43399 50.35465 49.28578
col17 col18 col19 col20
row1 50.86128 49.74176 50.07953 104.6289
> tmp[,"col10"]
col10
row1 50.13104
row2 30.38862
row3 30.39876
row4 29.68379
row5 48.81975
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 50.69773 48.78552 49.29037 50.68511 49.39976 102.8972 48.69186 51.57510
row5 51.39019 50.18031 51.45814 49.29042 49.73902 105.3642 48.92050 49.18985
col9 col10 col11 col12 col13 col14 col15 col16
row1 50.76782 50.13104 51.47118 50.13092 49.07401 50.43399 50.35465 49.28578
row5 51.36390 48.81975 50.06848 48.50747 49.01874 50.75120 50.00351 48.28740
col17 col18 col19 col20
row1 50.86128 49.74176 50.07953 104.6289
row5 49.65390 51.01607 48.15914 104.5162
> tmp[,c("col6","col20")]
col6 col20
row1 102.89715 104.62890
row2 75.03145 73.82553
row3 74.27807 75.50490
row4 75.44164 75.94555
row5 105.36418 104.51623
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 102.8972 104.6289
row5 105.3642 104.5162
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 102.8972 104.6289
row5 105.3642 104.5162
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.09429765
[2,] 0.63788508
[3,] 1.71694230
[4,] 1.35774426
[5,] 0.79643573
> tmp[,c("col17","col7")]
col17 col7
[1,] 0.10006651 -0.9364577
[2,] 1.24145911 -1.6084157
[3,] 1.18762049 -0.4162078
[4,] 0.26686822 -0.3504502
[5,] -0.04821572 0.6806770
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] -1.68267147 2.1534324
[2,] -0.93491622 0.1416718
[3,] -0.67917605 0.3712487
[4,] 0.02800479 -0.2721234
[5,] 1.02600089 0.6846302
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] -1.682671
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] -1.6826715
[2,] -0.9349162
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> rownames(tmp) <- rownames(tmp,do.NULL=FALSE)
>
>
>
>
> subBufferedMatrix(tmp,c("row3","row1"),)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6]
row3 -1.4113125 0.5028178 0.3188956 -0.4722315 -0.02924978 0.7552412
row1 0.2465754 -2.0948120 0.4866142 -0.3794417 -0.26425527 -1.4508579
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.8165983 -1.118846 -0.4934736 -0.2105814 -0.5444589 -2.096639 1.3637840
row1 0.4759818 -2.313251 0.1562253 -1.1482488 0.4626184 -0.344508 -0.3986305
[,14] [,15] [,16] [,17] [,18] [,19]
row3 0.4161857 0.7719421 -0.3419469 -1.1178631 0.6654635 1.36529090
row1 -0.1173606 -0.3247257 0.1307975 0.3368845 1.1717324 -0.09138868
[,20]
row3 0.05988514
row1 0.64607257
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 -0.232211 0.3060688 0.3273069 0.2449393 0.2333049 0.8523004 0.07923823
[,8] [,9] [,10]
row2 -0.3757323 -1.503728 0.7747672
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.9691698 1.34594 -1.719058 -0.3589125 0.2253477 -0.02909644 0.5101515
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 -0.7742796 1.123732 1.882687 1.352249 1.291117 -0.5244478 -0.99219
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.3453658 0.9082662 -1.803126 -0.5376838 0.1348194 0.8010228
>
>
> 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: 0x56ca71bf3e20>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f2eeb9b61"
[2] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f54ba76a"
[3] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f2af897b2"
[4] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f5bd4cd9f"
[5] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f5cec9a7a"
[6] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f3388e3f2"
[7] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f5db96229"
[8] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f76d4c17e"
[9] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f6b0b7e0"
[10] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f3c6e66fe"
[11] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f7d4c1686"
[12] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f44dcc755"
[13] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f1562c0a2"
[14] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f1060a505"
[15] "/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM13a56f22fc3fe1"
>
>
> ### 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: 0x56ca73a12640>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x56ca73a12640>
Warning message:
In dir.create(new.directory) :
'/home/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x56ca73a12640>
> rowMedians(tmp)
[1] 0.3160674061 -0.0555469539 -0.2605662676 -0.6183850091 -0.1452742885
[6] 0.0809686119 0.0464326250 0.1587514338 -0.2114886090 -0.0186023246
[11] 0.0385210570 -0.3729796937 0.3091390392 0.0912487812 -0.1605890796
[16] -0.2259471799 -0.1880771873 -0.3172501594 0.3644944686 -0.0738708724
[21] 0.0517383702 0.4054199632 -0.1665602559 0.2293343153 -0.3979483496
[26] 0.0004654963 0.4622331147 -0.2016774737 0.6663709443 0.5972472181
[31] 0.2731026806 0.6002478555 -0.1480641175 -0.1388961372 0.2451717459
[36] 0.0391059501 0.0787325494 -0.2425335113 0.1284965906 -0.1994818266
[41] 0.0850687355 -0.0626803649 -0.1774958554 -0.0111639851 0.0226957151
[46] -0.1891639549 -0.2899299101 -0.3938173341 -0.1788033108 -0.0272043512
[51] 0.4776703928 -0.1865315399 0.1560263781 -0.5290678258 -0.7003933842
[56] -0.7338392249 -0.1174764015 -0.4223785640 0.2851137325 -0.1366570253
[61] -0.1826321201 0.1910466467 0.1682458787 0.3052731701 0.1692827324
[66] 0.0998541169 0.3777902184 -0.2506846138 0.4077200975 -0.0308663068
[71] 0.2086999155 0.1656026892 -0.2713475964 -0.6117938622 0.3838142604
[76] 0.1030212606 -0.4940343526 -0.3409253801 -0.1163899395 0.2034492975
[81] 0.0796005078 -0.2021749966 -0.2663562614 0.7632225244 0.0217354344
[86] -0.0129268755 -0.1329180705 0.3197826704 -0.3340106131 -0.0382971394
[91] -0.2822276825 -0.3524351249 -0.2314264095 -0.0416497066 0.4525477757
[96] 0.0439107817 -0.5006515187 -0.2385026622 0.2432209799 -0.2667096626
[101] 0.0944345439 0.4122571852 -0.1059249546 0.2830710247 0.4010659220
[106] 0.0864737331 0.4702797362 -0.1386429719 0.0908403147 0.0987256675
[111] -0.1950805866 0.4206399119 -0.1685090476 -0.1156359559 0.1998928187
[116] 0.4546792936 0.2592779394 -0.1557852460 0.3810835562 0.3809167028
[121] -0.2178030710 -0.0191219629 0.1577728232 0.2669327336 -0.1718455332
[126] -0.5917789059 -0.1162691741 0.0219983988 -0.0773364584 0.1187382925
[131] -0.1863969159 -0.2274811926 -0.1100614083 -0.3837228018 0.0056378131
[136] -0.2723430910 0.4825054797 -0.0968088574 0.5371152197 -0.2270467351
[141] -0.2516142168 -0.1212923426 0.0730097176 0.0644019076 -0.2148329475
[146] 0.3673650885 -0.1656725427 0.2195567306 -0.7105939823 0.0808339415
[151] 0.8221996688 -0.1020494212 -0.0034358815 0.2300667176 0.4299272558
[156] -0.4898060405 -0.4071818665 0.5701748745 0.1889068233 -0.2608155550
[161] 0.0677465176 -0.3583161494 0.1723747541 -0.3247726270 0.1208417404
[166] -0.1240829216 0.3025606166 0.0130390053 -0.3037210238 0.6757000620
[171] -0.0514921810 0.0457204511 -0.0399312296 0.0378075198 -0.1191094911
[176] 0.2295980944 0.1031444087 -0.5163020946 0.1955609813 0.0737263113
[181] 0.1779110238 -0.2336104014 -0.1421559073 -0.1528736482 -0.4378310993
[186] 0.2680401652 0.3059574410 0.1077039688 -0.2668532358 0.1246937662
[191] -0.3434557464 -0.0010500213 -1.1049797398 -0.3641984122 0.0690463242
[196] 0.3538107102 0.2841920195 0.4197716258 0.2026747999 0.3800004468
[201] 0.2313330962 -0.1810649227 0.4186236472 -0.7009120315 0.8753288077
[206] 0.7553422089 0.1120504649 -0.0273850257 0.0058398599 0.1418538608
[211] -0.1111343695 -0.3161552288 0.5516240104 0.4743483596 -0.2824904135
[216] 0.3948338422 0.3360595384 0.0862086197 0.0179907492 -0.0087822677
[221] 0.2637599403 0.0034437092 -0.4573430407 0.0893458239 0.0022067116
[226] -0.0443517348 0.0824867607 0.7520832176 0.2531569518 -0.3850979728
>
> proc.time()
user system elapsed
1.337 1.527 2.860
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-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: 0x5a429b3500f0>
> .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: 0x5a429b3500f0>
> .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: 0x5a429b3500f0>
> .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: 0x5a429b3500f0>
> 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: 0x5a429c19e690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429c19e690>
> .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: 0x5a429c19e690>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429c19e690>
> .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: 0x5a429c19e690>
> 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: 0x5a429dbd8010>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429dbd8010>
> .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: 0x5a429dbd8010>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a429dbd8010>
> .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: 0x5a429dbd8010>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x5a429dbd8010>
> .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: 0x5a429dbd8010>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x5a429dbd8010>
> .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: 0x5a429dbd8010>
> 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: 0x5a429dc28070>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x5a429dc28070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429dc28070>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429dc28070>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13a79812f30f5" "BufferedMatrixFile13a798fd250d7"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile13a79812f30f5" "BufferedMatrixFile13a798fd250d7"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429b8e27e0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429b8e27e0>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a429b8e27e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x5a429b8e27e0>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x5a429b8e27e0>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x5a429b8e27e0>
> .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: 0x5a429d87e3b0>
> .Call("R_bm_AddColumn",P)
<pointer: 0x5a429d87e3b0>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x5a429d87e3b0>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x5a429d87e3b0>
> 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: 0x5a429ba44520>
> .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: 0x5a429ba44520>
> rm(P)
>
> proc.time()
user system elapsed
0.240 0.057 0.287
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R version 4.6.0 RC (2026-04-17 r89917) -- "Because it was There"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-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.251 0.039 0.277