| Back to Multiple platform build/check report for BioC 3.23: simplified long |
|
This page was generated on 2026-03-09 11:33 -0400 (Mon, 09 Mar 2026).
| Hostname | OS | Arch (*) | R version | Installed pkgs |
|---|---|---|---|---|
| nebbiolo1 | Linux (Ubuntu 24.04.3 LTS) | x86_64 | R Under development (unstable) (2026-03-05 r89546) -- "Unsuffered Consequences" | 4508 |
| kjohnson3 | macOS 13.7.7 Ventura | arm64 | R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences" | 3381 |
| 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 256/2360 | Hostname | OS / Arch | INSTALL | BUILD | CHECK | BUILD BIN | ||||||||
| BufferedMatrix 1.75.0 (landing page) Ben Bolstad
| nebbiolo1 | Linux (Ubuntu 24.04.3 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.75.0 |
| Command: /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz |
| StartedAt: 2026-03-08 16:38:53 -0400 (Sun, 08 Mar 2026) |
| EndedAt: 2026-03-08 16:39:14 -0400 (Sun, 08 Mar 2026) |
| EllapsedTime: 21.3 seconds |
| RetCode: 0 |
| Status: WARNINGS |
| CheckDir: BufferedMatrix.Rcheck |
| Warnings: 1 |
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD check --install=check:BufferedMatrix.install-out.txt --library=/Library/Frameworks/R.framework/Resources/library --no-vignettes --timings BufferedMatrix_1.75.0.tar.gz
###
##############################################################################
##############################################################################
* using log directory ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck’
* using R Under development (unstable) (2026-02-28 r89501)
* using platform: aarch64-apple-darwin20
* R was compiled by
Apple clang version 16.0.0 (clang-1600.0.26.6)
GNU Fortran (GCC) 14.2.0
* running under: macOS Sonoma 14.8.3
* using session charset: UTF-8
* current time: 2026-03-08 20:38:53 UTC
* using option ‘--no-vignettes’
* checking for file ‘BufferedMatrix/DESCRIPTION’ ... OK
* this is package ‘BufferedMatrix’ version ‘1.75.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 ... WARNING
Found the following significant warnings:
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
See ‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00install.out’ for details.
* used C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
* used SDK: ‘MacOSX11.3.1.sdk’
* 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 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’ ... OK
* 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: 1 WARNING, 1 NOTE
See
‘/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/00check.log’
for details.
BufferedMatrix.Rcheck/00install.out
##############################################################################
##############################################################################
###
### Running command:
###
### /Library/Frameworks/R.framework/Resources/bin/R CMD INSTALL BufferedMatrix
###
##############################################################################
##############################################################################
* installing to library ‘/Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/library’
* installing *source* package ‘BufferedMatrix’ ...
** this is package ‘BufferedMatrix’ version ‘1.75.0’
** using staged installation
** libs
using C compiler: ‘Apple clang version 15.0.0 (clang-1500.1.0.2.5)’
using SDK: ‘MacOSX11.3.1.sdk’
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c RBufferedMatrix.c -o RBufferedMatrix.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix.c -o doubleBufferedMatrix.o
doubleBufferedMatrix.c:1580:7: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if (!(Matrix->readonly) & setting){
^ ~
doubleBufferedMatrix.c:1580:7: note: add parentheses after the '!' to evaluate the bitwise operator first
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:1580:7: note: add parentheses around left hand side expression to silence this warning
if (!(Matrix->readonly) & setting){
^
( )
doubleBufferedMatrix.c:3327:12: warning: unused function 'sort_double' [-Wunused-function]
static int sort_double(const double *a1,const double *a2){
^
2 warnings generated.
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c doubleBufferedMatrix_C_tests.c -o doubleBufferedMatrix_C_tests.o
clang -arch arm64 -std=gnu2x -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I/opt/R/arm64/include -fPIC -falign-functions=64 -Wall -g -O2 -c init_package.c -o init_package.o
clang -arch arm64 -std=gnu2x -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/Library/Frameworks/R.framework/Resources/lib -L/opt/R/arm64/lib -o BufferedMatrix.so RBufferedMatrix.o doubleBufferedMatrix.o doubleBufferedMatrix_C_tests.o init_package.o -F/Library/Frameworks/R.framework/.. -framework R
installing to /Library/Frameworks/R.framework/Versions/4.6-arm64/Resources/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 Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.110 0.040 0.156
BufferedMatrix.Rcheck/tests/objectTesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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] "/Users/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) limit (Mb) max used (Mb)
Ncells 481912 25.8 1060020 56.7 NA 633742 33.9
Vcells 892229 6.9 8388608 64.0 196608 2111484 16.2
>
>
>
>
> ##
> ## 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] "Sun Mar 8 16:39:05 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] "Sun Mar 8 16:39:05 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: 0x600000e94180>
>
>
>
> 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] "Sun Mar 8 16:39:07 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] "Sun Mar 8 16:39:07 2026"
>
> ColMode(tmp2)
<pointer: 0x600000e94180>
>
>
>
> ### 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,] 99.7480623 0.2992088 -0.2741172 -1.39170216
[2,] 1.0675325 0.2000911 0.5091422 1.95184480
[3,] -0.1087321 1.3444025 1.1641008 -0.63915134
[4,] 0.2039662 1.1792009 -0.4681616 0.09413674
> ewApply(tmp5,abs)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 99.7480623 0.2992088 0.2741172 1.39170216
[2,] 1.0675325 0.2000911 0.5091422 1.95184480
[3,] 0.1087321 1.3444025 1.1641008 0.63915134
[4,] 0.2039662 1.1792009 0.4681616 0.09413674
> ewApply(tmp5,sqrt)
BufferedMatrix object
Matrix size: 10 20
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 9.9873952 0.5469999 0.5235621 1.1797043
[2,] 1.0332146 0.4473154 0.7135420 1.3970844
[3,] 0.3297455 1.1594837 1.0789350 0.7994694
[4,] 0.4516262 1.0859102 0.6842234 0.3068171
>
> 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: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 1.9 Kilobytes.
Disk usage : 1.6 Kilobytes.
> tmp5[1:4,1:4]
[,1] [,2] [,3] [,4]
[1,] 224.62201 30.76921 30.50974 38.18874
[2,] 36.39968 29.67325 32.64456 40.92269
[3,] 28.40619 37.93924 36.95345 33.63385
[4,] 29.72023 37.03830 32.31040 28.16231
>
>
>
> ## testing functions that elementwise transform the matrix
> sqrt(tmp5)
<pointer: 0x600000e901e0>
> exp(tmp5)
<pointer: 0x600000e901e0>
> log(tmp5,2)
<pointer: 0x600000e901e0>
> pow(tmp5,2)
>
>
>
>
>
> ## testing functions that apply to entire matrix
> Max(tmp5)
[1] 467.5213
> Min(tmp5)
[1] 52.76219
> mean(tmp5)
[1] 71.97332
> Sum(tmp5)
[1] 14394.66
> Var(tmp5)
[1] 861.4109
>
>
> ## testing functions applied to rows or columns
>
> rowMeans(tmp5)
[1] 89.13536 69.69054 68.58708 70.50219 70.86574 66.34327 74.12313 70.54543
[9] 71.40744 68.53300
> rowSums(tmp5)
[1] 1782.707 1393.811 1371.742 1410.044 1417.315 1326.865 1482.463 1410.909
[9] 1428.149 1370.660
> rowVars(tmp5)
[1] 8002.94960 47.18894 66.34893 75.61196 55.58712 51.74496
[7] 98.97064 67.09319 67.24024 105.07479
> rowSd(tmp5)
[1] 89.459206 6.869421 8.145486 8.695514 7.455677 7.193397 9.948399
[8] 8.191043 8.200014 10.250600
> rowMax(tmp5)
[1] 467.52129 85.17521 81.47052 91.27825 86.75551 79.57500 98.51335
[8] 81.48759 83.73417 87.88166
> rowMin(tmp5)
[1] 57.64689 60.78717 57.71405 57.82445 54.16449 56.53522 56.58892 52.76219
[9] 59.05171 56.11412
>
> colMeans(tmp5)
[1] 106.60452 68.81151 67.87718 72.74540 67.30342 70.03960 71.06101
[8] 70.20653 67.20001 72.06334 68.70576 70.18518 68.71826 71.51602
[15] 71.86954 70.86680 67.15031 72.40619 73.39045 70.74537
> colSums(tmp5)
[1] 1066.0452 688.1151 678.7718 727.4540 673.0342 700.3960 710.6101
[8] 702.0653 672.0001 720.6334 687.0576 701.8518 687.1826 715.1602
[15] 718.6954 708.6680 671.5031 724.0619 733.9045 707.4537
> colVars(tmp5)
[1] 16117.26029 80.07551 59.25266 65.45129 45.69811 55.20782
[7] 79.27855 72.36611 170.13388 28.41985 36.96848 65.50870
[13] 114.92986 70.79473 73.27750 66.61084 51.31340 141.58633
[19] 119.71946 53.04861
> colSd(tmp5)
[1] 126.953772 8.948492 7.697575 8.090197 6.760038 7.430197
[7] 8.903850 8.506827 13.043538 5.331027 6.080171 8.093745
[13] 10.720534 8.413961 8.560228 8.161547 7.163337 11.899005
[19] 10.941639 7.283448
> colMax(tmp5)
[1] 467.52129 86.75551 82.44121 85.17521 76.43988 79.16365 86.18295
[8] 79.45825 89.44577 77.42657 78.40728 83.55211 88.64757 84.49041
[15] 82.49010 80.34067 80.35699 98.51335 91.27825 87.61170
> colMin(tmp5)
[1] 59.12376 60.69138 56.58892 58.61615 57.99770 60.09105 57.71405 56.53522
[9] 52.76219 60.01666 56.38472 60.27972 57.64689 59.41660 56.63848 54.16449
[17] 57.82445 60.33917 59.05171 58.46558
>
>
> ### setting a random element to NA and then testing with na.rm=TRUE or na.rm=FALSE (The default)
>
>
> which.row <- sample(1:10,1,replace=TRUE)
> which.col <- sample(1:20,1,replace=TRUE)
>
> tmp5[which.row,which.col] <- NA
>
> Max(tmp5)
[1] NA
> Min(tmp5)
[1] NA
> mean(tmp5)
[1] NA
> Sum(tmp5)
[1] NA
> Var(tmp5)
[1] NA
>
> rowMeans(tmp5)
[1] 89.13536 69.69054 68.58708 70.50219 70.86574 66.34327 NA 70.54543
[9] 71.40744 68.53300
> rowSums(tmp5)
[1] 1782.707 1393.811 1371.742 1410.044 1417.315 1326.865 NA 1410.909
[9] 1428.149 1370.660
> rowVars(tmp5)
[1] 8002.94960 47.18894 66.34893 75.61196 55.58712 51.74496
[7] 102.92299 67.09319 67.24024 105.07479
> rowSd(tmp5)
[1] 89.459206 6.869421 8.145486 8.695514 7.455677 7.193397 10.145097
[8] 8.191043 8.200014 10.250600
> rowMax(tmp5)
[1] 467.52129 85.17521 81.47052 91.27825 86.75551 79.57500 NA
[8] 81.48759 83.73417 87.88166
> rowMin(tmp5)
[1] 57.64689 60.78717 57.71405 57.82445 54.16449 56.53522 NA 52.76219
[9] 59.05171 56.11412
>
> colMeans(tmp5)
[1] 106.60452 68.81151 67.87718 NA 67.30342 70.03960 71.06101
[8] 70.20653 67.20001 72.06334 68.70576 70.18518 68.71826 71.51602
[15] 71.86954 70.86680 67.15031 72.40619 73.39045 70.74537
> colSums(tmp5)
[1] 1066.0452 688.1151 678.7718 NA 673.0342 700.3960 710.6101
[8] 702.0653 672.0001 720.6334 687.0576 701.8518 687.1826 715.1602
[15] 718.6954 708.6680 671.5031 724.0619 733.9045 707.4537
> colVars(tmp5)
[1] 16117.26029 80.07551 59.25266 NA 45.69811 55.20782
[7] 79.27855 72.36611 170.13388 28.41985 36.96848 65.50870
[13] 114.92986 70.79473 73.27750 66.61084 51.31340 141.58633
[19] 119.71946 53.04861
> colSd(tmp5)
[1] 126.953772 8.948492 7.697575 NA 6.760038 7.430197
[7] 8.903850 8.506827 13.043538 5.331027 6.080171 8.093745
[13] 10.720534 8.413961 8.560228 8.161547 7.163337 11.899005
[19] 10.941639 7.283448
> colMax(tmp5)
[1] 467.52129 86.75551 82.44121 NA 76.43988 79.16365 86.18295
[8] 79.45825 89.44577 77.42657 78.40728 83.55211 88.64757 84.49041
[15] 82.49010 80.34067 80.35699 98.51335 91.27825 87.61170
> colMin(tmp5)
[1] 59.12376 60.69138 56.58892 NA 57.99770 60.09105 57.71405 56.53522
[9] 52.76219 60.01666 56.38472 60.27972 57.64689 59.41660 56.63848 54.16449
[17] 57.82445 60.33917 59.05171 58.46558
>
> Max(tmp5,na.rm=TRUE)
[1] 467.5213
> Min(tmp5,na.rm=TRUE)
[1] 52.76219
> mean(tmp5,na.rm=TRUE)
[1] 71.93668
> Sum(tmp5,na.rm=TRUE)
[1] 14315.4
> Var(tmp5,na.rm=TRUE)
[1] 865.4916
>
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.13536 69.69054 68.58708 70.50219 70.86574 66.34327 73.85251 70.54543
[9] 71.40744 68.53300
> rowSums(tmp5,na.rm=TRUE)
[1] 1782.707 1393.811 1371.742 1410.044 1417.315 1326.865 1403.198 1410.909
[9] 1428.149 1370.660
> rowVars(tmp5,na.rm=TRUE)
[1] 8002.94960 47.18894 66.34893 75.61196 55.58712 51.74496
[7] 102.92299 67.09319 67.24024 105.07479
> rowSd(tmp5,na.rm=TRUE)
[1] 89.459206 6.869421 8.145486 8.695514 7.455677 7.193397 10.145097
[8] 8.191043 8.200014 10.250600
> rowMax(tmp5,na.rm=TRUE)
[1] 467.52129 85.17521 81.47052 91.27825 86.75551 79.57500 98.51335
[8] 81.48759 83.73417 87.88166
> rowMin(tmp5,na.rm=TRUE)
[1] 57.64689 60.78717 57.71405 57.82445 54.16449 56.53522 56.58892 52.76219
[9] 59.05171 56.11412
>
> colMeans(tmp5,na.rm=TRUE)
[1] 106.60452 68.81151 67.87718 72.02102 67.30342 70.03960 71.06101
[8] 70.20653 67.20001 72.06334 68.70576 70.18518 68.71826 71.51602
[15] 71.86954 70.86680 67.15031 72.40619 73.39045 70.74537
> colSums(tmp5,na.rm=TRUE)
[1] 1066.0452 688.1151 678.7718 648.1892 673.0342 700.3960 710.6101
[8] 702.0653 672.0001 720.6334 687.0576 701.8518 687.1826 715.1602
[15] 718.6954 708.6680 671.5031 724.0619 733.9045 707.4537
> colVars(tmp5,na.rm=TRUE)
[1] 16117.26029 80.07551 59.25266 67.72955 45.69811 55.20782
[7] 79.27855 72.36611 170.13388 28.41985 36.96848 65.50870
[13] 114.92986 70.79473 73.27750 66.61084 51.31340 141.58633
[19] 119.71946 53.04861
> colSd(tmp5,na.rm=TRUE)
[1] 126.953772 8.948492 7.697575 8.229796 6.760038 7.430197
[7] 8.903850 8.506827 13.043538 5.331027 6.080171 8.093745
[13] 10.720534 8.413961 8.560228 8.161547 7.163337 11.899005
[19] 10.941639 7.283448
> colMax(tmp5,na.rm=TRUE)
[1] 467.52129 86.75551 82.44121 85.17521 76.43988 79.16365 86.18295
[8] 79.45825 89.44577 77.42657 78.40728 83.55211 88.64757 84.49041
[15] 82.49010 80.34067 80.35699 98.51335 91.27825 87.61170
> colMin(tmp5,na.rm=TRUE)
[1] 59.12376 60.69138 56.58892 58.61615 57.99770 60.09105 57.71405 56.53522
[9] 52.76219 60.01666 56.38472 60.27972 57.64689 59.41660 56.63848 54.16449
[17] 57.82445 60.33917 59.05171 58.46558
>
> # now set an entire row to NA
>
> tmp5[which.row,] <- NA
> rowMeans(tmp5,na.rm=TRUE)
[1] 89.13536 69.69054 68.58708 70.50219 70.86574 66.34327 NaN 70.54543
[9] 71.40744 68.53300
> rowSums(tmp5,na.rm=TRUE)
[1] 1782.707 1393.811 1371.742 1410.044 1417.315 1326.865 0.000 1410.909
[9] 1428.149 1370.660
> rowVars(tmp5,na.rm=TRUE)
[1] 8002.94960 47.18894 66.34893 75.61196 55.58712 51.74496
[7] NA 67.09319 67.24024 105.07479
> rowSd(tmp5,na.rm=TRUE)
[1] 89.459206 6.869421 8.145486 8.695514 7.455677 7.193397 NA
[8] 8.191043 8.200014 10.250600
> rowMax(tmp5,na.rm=TRUE)
[1] 467.52129 85.17521 81.47052 91.27825 86.75551 79.57500 NA
[8] 81.48759 83.73417 87.88166
> rowMin(tmp5,na.rm=TRUE)
[1] 57.64689 60.78717 57.71405 57.82445 54.16449 56.53522 NA 52.76219
[9] 59.05171 56.11412
>
>
> # now set an entire col to NA
>
>
> tmp5[,which.col] <- NA
> colMeans(tmp5,na.rm=TRUE)
[1] 111.29794 69.20182 69.13144 NaN 66.78288 69.08301 71.97540
[8] 69.20678 65.77064 72.47298 68.43818 68.69996 66.50389 70.95458
[15] 70.68947 70.87127 67.33087 69.50539 74.15558 70.59591
> colSums(tmp5,na.rm=TRUE)
[1] 1001.6815 622.8164 622.1829 0.0000 601.0459 621.7471 647.7786
[8] 622.8611 591.9358 652.2568 615.9436 618.2997 598.5350 638.5912
[15] 636.2053 637.8415 605.9779 625.5485 667.4003 635.3632
> colVars(tmp5,na.rm=TRUE)
[1] 17884.10061 88.37108 48.96132 NA 48.36196 51.81449
[7] 79.78219 70.16754 168.41593 30.08454 40.78407 48.88133
[13] 74.13254 76.09790 66.77101 74.93697 57.36077 64.62016
[19] 128.09834 59.42839
> colSd(tmp5,na.rm=TRUE)
[1] 133.731450 9.400589 6.997237 NA 6.954276 7.198228
[7] 8.932088 8.376607 12.977516 5.484938 6.386241 6.991518
[13] 8.610026 8.723411 8.171353 8.656614 7.573690 8.038667
[19] 11.318054 7.708981
> colMax(tmp5,na.rm=TRUE)
[1] 467.52129 86.75551 82.44121 -Inf 76.43988 79.16365 86.18295
[8] 79.45825 89.44577 77.42657 78.40728 81.48759 85.94782 84.49041
[15] 81.99966 80.34067 80.35699 83.73417 91.27825 87.61170
> colMin(tmp5,na.rm=TRUE)
[1] 59.12376 60.69138 61.59011 Inf 57.99770 60.09105 57.71405 56.53522
[9] 52.76219 60.01666 56.38472 60.27972 57.64689 59.41660 56.63848 54.16449
[17] 57.82445 60.33917 59.05171 58.46558
>
>
>
>
> 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] 165.1286 168.9284 321.8656 123.3417 240.3562 207.9366 212.9582 171.0663
[9] 156.3494 140.8626
> apply(copymatrix,1,var,na.rm=TRUE)
[1] 165.1286 168.9284 321.8656 123.3417 240.3562 207.9366 212.9582 171.0663
[9] 156.3494 140.8626
>
>
>
> 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.989520e-13 2.842171e-14 5.684342e-14 9.947598e-14 0.000000e+00
[6] -5.684342e-14 1.136868e-13 0.000000e+00 -2.842171e-14 0.000000e+00
[11] 1.136868e-13 2.842171e-14 5.684342e-14 -8.526513e-14 0.000000e+00
[16] 0.000000e+00 -1.421085e-13 1.421085e-13 5.684342e-14 2.842171e-14
>
>
>
>
>
>
>
>
>
>
> ## making sure these things agree
> ##
> ## first when there is no NA
>
>
>
> agree.checks <- function(buff.matrix,r.matrix,err.tol=1e-10){
+
+ if (Max(buff.matrix,na.rm=TRUE) != max(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Max")
+ }
+
+
+ if (Min(buff.matrix,na.rm=TRUE) != min(r.matrix,na.rm=TRUE)){
+ stop("No agreement in Min")
+ }
+
+
+ if (abs(Sum(buff.matrix,na.rm=TRUE)- sum(r.matrix,na.rm=TRUE)) > err.tol){
+
+ cat(Sum(buff.matrix,na.rm=TRUE),"\n")
+ cat(sum(r.matrix,na.rm=TRUE),"\n")
+ cat(Sum(buff.matrix,na.rm=TRUE) - sum(r.matrix,na.rm=TRUE),"\n")
+
+ stop("No agreement in Sum")
+ }
+
+ if (abs(mean(buff.matrix,na.rm=TRUE) - mean(r.matrix,na.rm=TRUE)) > err.tol){
+ stop("No agreement in mean")
+ }
+
+
+ if(abs(Var(buff.matrix,na.rm=TRUE) - var(as.vector(r.matrix),na.rm=TRUE)) > err.tol){
+ stop("No agreement in Var")
+ }
+
+
+
+ if(any(abs(rowMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,mean,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowMeans")
+ }
+
+
+ if(any(abs(colMeans(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,mean,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colMeans")
+ }
+
+
+ if(any(abs(rowSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in rowSums")
+ }
+
+
+ if(any(abs(colSums(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,sum,na.rm=TRUE))> err.tol,na.rm=TRUE)){
+ stop("No agreement in colSums")
+ }
+
+ ### this is to get around the fact that R doesn't like to compute NA on an entire vector of NA when
+ ### computing variance
+ my.Var <- function(x,na.rm=FALSE){
+ if (all(is.na(x))){
+ return(NA)
+ } else {
+ var(x,na.rm=na.rm)
+ }
+
+ }
+
+ if(any(abs(rowVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(colVars(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,my.Var,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in rowVars")
+ }
+
+
+ if(any(abs(rowMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+ if(any(abs(colMax(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,max,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMax")
+ }
+
+
+
+ if(any(abs(rowMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,1,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+
+ if(any(abs(colMin(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,min,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMin")
+ }
+
+ if(any(abs(colMedians(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,median,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colMedian")
+ }
+
+ if(any(abs(colRanges(buff.matrix,na.rm=TRUE) - apply(r.matrix,2,range,na.rm=TRUE)) > err.tol,na.rm=TRUE)){
+ stop("No agreement in colRanges")
+ }
+
+
+
+ }
>
>
>
>
>
>
>
>
>
> for (rep in 1:20){
+ copymatrix <- matrix(rnorm(200,150,15),10,20)
+
+ tmp5[1:10,1:20] <- copymatrix
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ## now lets assign some NA values and check agreement
+
+ which.row <- sample(1:10,1,replace=TRUE)
+ which.col <- sample(1:20,1,replace=TRUE)
+
+ cat(which.row," ",which.col,"\n")
+
+ tmp5[which.row,which.col] <- NA
+ copymatrix[which.row,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ## make an entire row NA
+ tmp5[which.row,] <- NA
+ copymatrix[which.row,] <- NA
+
+
+ agree.checks(tmp5,copymatrix)
+
+ ### also make an entire col NA
+ tmp5[,which.col] <- NA
+ copymatrix[,which.col] <- NA
+
+ agree.checks(tmp5,copymatrix)
+
+ ### now make 1 element non NA with NA in the rest of row and column
+
+ tmp5[which.row,which.col] <- rnorm(1,150,15)
+ copymatrix[which.row,which.col] <- tmp5[which.row,which.col]
+
+ agree.checks(tmp5,copymatrix)
+ }
7 8
3 13
9 12
8 1
10 6
5 9
5 4
3 4
3 12
7 11
3 5
3 7
7 9
5 8
1 7
6 5
4 6
10 19
9 5
8 15
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.311036
> Min(tmp)
[1] -2.259707
> mean(tmp)
[1] -0.08345788
> Sum(tmp)
[1] -8.345788
> Var(tmp)
[1] 0.9638789
>
> rowMeans(tmp)
[1] -0.08345788
> rowSums(tmp)
[1] -8.345788
> rowVars(tmp)
[1] 0.9638789
> rowSd(tmp)
[1] 0.9817734
> rowMax(tmp)
[1] 2.311036
> rowMin(tmp)
[1] -2.259707
>
> colMeans(tmp)
[1] 0.53790957 -0.79240543 -1.25453750 -0.93112729 0.73171353 -0.01673377
[7] 0.11881736 0.98085933 0.29205664 -1.31396344 -0.33036738 0.38156289
[13] 0.68247529 1.06389419 -1.29380409 2.31103637 -0.56545678 -0.31069174
[19] -0.63735153 -1.26270324 0.99158874 0.96692061 -0.97812284 -0.56404215
[25] -1.52042214 0.10321564 0.13342402 0.43873775 -1.79263822 -0.12065138
[31] -0.66268151 0.42060991 0.57089709 1.17278742 -0.54164915 0.39810328
[37] 0.40060133 0.88081637 0.70956121 -0.20509793 -0.42347203 -0.73832291
[43] -1.08722350 0.45217485 0.79266597 0.59379093 0.68447787 -0.74369913
[49] -2.25155738 1.44569225 -1.40155811 -0.15860671 0.45729164 -0.76140593
[55] 0.82611243 -0.36447398 -0.25744473 -2.00372586 -0.35998488 1.46901886
[61] -0.81924149 0.35668096 1.06463000 -0.15350937 -1.97522490 0.26989247
[67] -1.25005539 0.09008137 -1.42730879 0.27660636 1.72356374 -0.07218904
[73] -1.31091535 0.68480452 0.95291503 0.55810173 0.07843136 -1.15820737
[79] 0.87420888 0.12984042 -0.53157434 0.64893519 0.02660673 -1.40222354
[85] 0.25762332 -1.50809015 -2.25970700 -1.11780771 1.24687077 -0.92798549
[91] 1.30217300 1.44707414 -0.07626424 1.35371485 -1.97783086 -0.22511044
[97] -0.11264597 0.51425631 1.28220577 -0.54200444
> colSums(tmp)
[1] 0.53790957 -0.79240543 -1.25453750 -0.93112729 0.73171353 -0.01673377
[7] 0.11881736 0.98085933 0.29205664 -1.31396344 -0.33036738 0.38156289
[13] 0.68247529 1.06389419 -1.29380409 2.31103637 -0.56545678 -0.31069174
[19] -0.63735153 -1.26270324 0.99158874 0.96692061 -0.97812284 -0.56404215
[25] -1.52042214 0.10321564 0.13342402 0.43873775 -1.79263822 -0.12065138
[31] -0.66268151 0.42060991 0.57089709 1.17278742 -0.54164915 0.39810328
[37] 0.40060133 0.88081637 0.70956121 -0.20509793 -0.42347203 -0.73832291
[43] -1.08722350 0.45217485 0.79266597 0.59379093 0.68447787 -0.74369913
[49] -2.25155738 1.44569225 -1.40155811 -0.15860671 0.45729164 -0.76140593
[55] 0.82611243 -0.36447398 -0.25744473 -2.00372586 -0.35998488 1.46901886
[61] -0.81924149 0.35668096 1.06463000 -0.15350937 -1.97522490 0.26989247
[67] -1.25005539 0.09008137 -1.42730879 0.27660636 1.72356374 -0.07218904
[73] -1.31091535 0.68480452 0.95291503 0.55810173 0.07843136 -1.15820737
[79] 0.87420888 0.12984042 -0.53157434 0.64893519 0.02660673 -1.40222354
[85] 0.25762332 -1.50809015 -2.25970700 -1.11780771 1.24687077 -0.92798549
[91] 1.30217300 1.44707414 -0.07626424 1.35371485 -1.97783086 -0.22511044
[97] -0.11264597 0.51425631 1.28220577 -0.54200444
> 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.53790957 -0.79240543 -1.25453750 -0.93112729 0.73171353 -0.01673377
[7] 0.11881736 0.98085933 0.29205664 -1.31396344 -0.33036738 0.38156289
[13] 0.68247529 1.06389419 -1.29380409 2.31103637 -0.56545678 -0.31069174
[19] -0.63735153 -1.26270324 0.99158874 0.96692061 -0.97812284 -0.56404215
[25] -1.52042214 0.10321564 0.13342402 0.43873775 -1.79263822 -0.12065138
[31] -0.66268151 0.42060991 0.57089709 1.17278742 -0.54164915 0.39810328
[37] 0.40060133 0.88081637 0.70956121 -0.20509793 -0.42347203 -0.73832291
[43] -1.08722350 0.45217485 0.79266597 0.59379093 0.68447787 -0.74369913
[49] -2.25155738 1.44569225 -1.40155811 -0.15860671 0.45729164 -0.76140593
[55] 0.82611243 -0.36447398 -0.25744473 -2.00372586 -0.35998488 1.46901886
[61] -0.81924149 0.35668096 1.06463000 -0.15350937 -1.97522490 0.26989247
[67] -1.25005539 0.09008137 -1.42730879 0.27660636 1.72356374 -0.07218904
[73] -1.31091535 0.68480452 0.95291503 0.55810173 0.07843136 -1.15820737
[79] 0.87420888 0.12984042 -0.53157434 0.64893519 0.02660673 -1.40222354
[85] 0.25762332 -1.50809015 -2.25970700 -1.11780771 1.24687077 -0.92798549
[91] 1.30217300 1.44707414 -0.07626424 1.35371485 -1.97783086 -0.22511044
[97] -0.11264597 0.51425631 1.28220577 -0.54200444
> colMin(tmp)
[1] 0.53790957 -0.79240543 -1.25453750 -0.93112729 0.73171353 -0.01673377
[7] 0.11881736 0.98085933 0.29205664 -1.31396344 -0.33036738 0.38156289
[13] 0.68247529 1.06389419 -1.29380409 2.31103637 -0.56545678 -0.31069174
[19] -0.63735153 -1.26270324 0.99158874 0.96692061 -0.97812284 -0.56404215
[25] -1.52042214 0.10321564 0.13342402 0.43873775 -1.79263822 -0.12065138
[31] -0.66268151 0.42060991 0.57089709 1.17278742 -0.54164915 0.39810328
[37] 0.40060133 0.88081637 0.70956121 -0.20509793 -0.42347203 -0.73832291
[43] -1.08722350 0.45217485 0.79266597 0.59379093 0.68447787 -0.74369913
[49] -2.25155738 1.44569225 -1.40155811 -0.15860671 0.45729164 -0.76140593
[55] 0.82611243 -0.36447398 -0.25744473 -2.00372586 -0.35998488 1.46901886
[61] -0.81924149 0.35668096 1.06463000 -0.15350937 -1.97522490 0.26989247
[67] -1.25005539 0.09008137 -1.42730879 0.27660636 1.72356374 -0.07218904
[73] -1.31091535 0.68480452 0.95291503 0.55810173 0.07843136 -1.15820737
[79] 0.87420888 0.12984042 -0.53157434 0.64893519 0.02660673 -1.40222354
[85] 0.25762332 -1.50809015 -2.25970700 -1.11780771 1.24687077 -0.92798549
[91] 1.30217300 1.44707414 -0.07626424 1.35371485 -1.97783086 -0.22511044
[97] -0.11264597 0.51425631 1.28220577 -0.54200444
> colMedians(tmp)
[1] 0.53790957 -0.79240543 -1.25453750 -0.93112729 0.73171353 -0.01673377
[7] 0.11881736 0.98085933 0.29205664 -1.31396344 -0.33036738 0.38156289
[13] 0.68247529 1.06389419 -1.29380409 2.31103637 -0.56545678 -0.31069174
[19] -0.63735153 -1.26270324 0.99158874 0.96692061 -0.97812284 -0.56404215
[25] -1.52042214 0.10321564 0.13342402 0.43873775 -1.79263822 -0.12065138
[31] -0.66268151 0.42060991 0.57089709 1.17278742 -0.54164915 0.39810328
[37] 0.40060133 0.88081637 0.70956121 -0.20509793 -0.42347203 -0.73832291
[43] -1.08722350 0.45217485 0.79266597 0.59379093 0.68447787 -0.74369913
[49] -2.25155738 1.44569225 -1.40155811 -0.15860671 0.45729164 -0.76140593
[55] 0.82611243 -0.36447398 -0.25744473 -2.00372586 -0.35998488 1.46901886
[61] -0.81924149 0.35668096 1.06463000 -0.15350937 -1.97522490 0.26989247
[67] -1.25005539 0.09008137 -1.42730879 0.27660636 1.72356374 -0.07218904
[73] -1.31091535 0.68480452 0.95291503 0.55810173 0.07843136 -1.15820737
[79] 0.87420888 0.12984042 -0.53157434 0.64893519 0.02660673 -1.40222354
[85] 0.25762332 -1.50809015 -2.25970700 -1.11780771 1.24687077 -0.92798549
[91] 1.30217300 1.44707414 -0.07626424 1.35371485 -1.97783086 -0.22511044
[97] -0.11264597 0.51425631 1.28220577 -0.54200444
> colRanges(tmp)
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 0.5379096 -0.7924054 -1.254538 -0.9311273 0.7317135 -0.01673377 0.1188174
[2,] 0.5379096 -0.7924054 -1.254538 -0.9311273 0.7317135 -0.01673377 0.1188174
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
[1,] 0.9808593 0.2920566 -1.313963 -0.3303674 0.3815629 0.6824753 1.063894
[2,] 0.9808593 0.2920566 -1.313963 -0.3303674 0.3815629 0.6824753 1.063894
[,15] [,16] [,17] [,18] [,19] [,20] [,21]
[1,] -1.293804 2.311036 -0.5654568 -0.3106917 -0.6373515 -1.262703 0.9915887
[2,] -1.293804 2.311036 -0.5654568 -0.3106917 -0.6373515 -1.262703 0.9915887
[,22] [,23] [,24] [,25] [,26] [,27] [,28]
[1,] 0.9669206 -0.9781228 -0.5640421 -1.520422 0.1032156 0.133424 0.4387377
[2,] 0.9669206 -0.9781228 -0.5640421 -1.520422 0.1032156 0.133424 0.4387377
[,29] [,30] [,31] [,32] [,33] [,34] [,35]
[1,] -1.792638 -0.1206514 -0.6626815 0.4206099 0.5708971 1.172787 -0.5416491
[2,] -1.792638 -0.1206514 -0.6626815 0.4206099 0.5708971 1.172787 -0.5416491
[,36] [,37] [,38] [,39] [,40] [,41] [,42]
[1,] 0.3981033 0.4006013 0.8808164 0.7095612 -0.2050979 -0.423472 -0.7383229
[2,] 0.3981033 0.4006013 0.8808164 0.7095612 -0.2050979 -0.423472 -0.7383229
[,43] [,44] [,45] [,46] [,47] [,48] [,49]
[1,] -1.087224 0.4521748 0.792666 0.5937909 0.6844779 -0.7436991 -2.251557
[2,] -1.087224 0.4521748 0.792666 0.5937909 0.6844779 -0.7436991 -2.251557
[,50] [,51] [,52] [,53] [,54] [,55] [,56]
[1,] 1.445692 -1.401558 -0.1586067 0.4572916 -0.7614059 0.8261124 -0.364474
[2,] 1.445692 -1.401558 -0.1586067 0.4572916 -0.7614059 0.8261124 -0.364474
[,57] [,58] [,59] [,60] [,61] [,62] [,63]
[1,] -0.2574447 -2.003726 -0.3599849 1.469019 -0.8192415 0.356681 1.06463
[2,] -0.2574447 -2.003726 -0.3599849 1.469019 -0.8192415 0.356681 1.06463
[,64] [,65] [,66] [,67] [,68] [,69] [,70]
[1,] -0.1535094 -1.975225 0.2698925 -1.250055 0.09008137 -1.427309 0.2766064
[2,] -0.1535094 -1.975225 0.2698925 -1.250055 0.09008137 -1.427309 0.2766064
[,71] [,72] [,73] [,74] [,75] [,76] [,77]
[1,] 1.723564 -0.07218904 -1.310915 0.6848045 0.952915 0.5581017 0.07843136
[2,] 1.723564 -0.07218904 -1.310915 0.6848045 0.952915 0.5581017 0.07843136
[,78] [,79] [,80] [,81] [,82] [,83] [,84]
[1,] -1.158207 0.8742089 0.1298404 -0.5315743 0.6489352 0.02660673 -1.402224
[2,] -1.158207 0.8742089 0.1298404 -0.5315743 0.6489352 0.02660673 -1.402224
[,85] [,86] [,87] [,88] [,89] [,90] [,91]
[1,] 0.2576233 -1.50809 -2.259707 -1.117808 1.246871 -0.9279855 1.302173
[2,] 0.2576233 -1.50809 -2.259707 -1.117808 1.246871 -0.9279855 1.302173
[,92] [,93] [,94] [,95] [,96] [,97] [,98]
[1,] 1.447074 -0.07626424 1.353715 -1.977831 -0.2251104 -0.112646 0.5142563
[2,] 1.447074 -0.07626424 1.353715 -1.977831 -0.2251104 -0.112646 0.5142563
[,99] [,100]
[1,] 1.282206 -0.5420044
[2,] 1.282206 -0.5420044
>
>
> Max(tmp2)
[1] 2.770413
> Min(tmp2)
[1] -2.881713
> mean(tmp2)
[1] -0.2416467
> Sum(tmp2)
[1] -24.16467
> Var(tmp2)
[1] 1.077796
>
> rowMeans(tmp2)
[1] -0.3162667366 -2.1656437325 0.1964899481 -0.1076285926 -1.3397633008
[6] -0.5244017800 -0.0514112308 -1.0567794909 0.3270004740 0.0880612317
[11] -0.3517164874 -1.2941488589 0.8793514269 -0.7541761185 0.1318489583
[16] -0.4455712162 1.5160098209 -0.6713762132 -0.9622328809 -0.4156088030
[21] -0.1057604104 -0.1080067912 1.0760710189 -2.2282018191 0.1691822756
[26] 0.2119331993 -2.0032428528 0.1292716023 1.4784947389 -2.5275308229
[31] -0.7835384891 0.0481874173 -1.4669364872 1.1537231970 -1.9064883536
[36] -0.2459739423 0.8726698572 -0.4969926094 1.7752497452 0.2624641609
[41] -0.2309074089 -0.1516116112 -1.1909065323 0.0002574002 -1.5424558981
[46] -0.2960187897 -1.6423932082 -0.7875822410 0.9219703260 -0.8369667908
[51] -2.2088716251 0.8253377389 -0.8442818545 0.1563437055 -2.8817125284
[56] 1.1978028426 1.5668250370 0.6274130305 -1.4818866246 0.1270419269
[61] 0.2910166466 -0.0295232749 -1.7860117818 -0.5994955024 -0.3225441613
[66] -0.0733563571 0.6458471087 0.4863267973 -0.4962715097 1.7651987690
[71] -0.9342075774 -0.9347409249 -0.7135320522 -2.2911052459 0.2218280798
[76] 0.2580977620 -0.5894534196 0.5818916346 0.4231251079 1.0169511218
[81] 2.7704127651 -0.6164927112 0.5238315479 -0.5324345153 0.4030315456
[86] 1.0867954321 0.6053924792 -0.5237987183 0.0808417657 0.0562344034
[91] -0.2619032488 -0.2472796672 -0.1873331646 -1.7810937991 0.0551700542
[96] -0.8612402872 -0.9936895944 0.9046355703 -1.5022627792 0.6224666416
> rowSums(tmp2)
[1] -0.3162667366 -2.1656437325 0.1964899481 -0.1076285926 -1.3397633008
[6] -0.5244017800 -0.0514112308 -1.0567794909 0.3270004740 0.0880612317
[11] -0.3517164874 -1.2941488589 0.8793514269 -0.7541761185 0.1318489583
[16] -0.4455712162 1.5160098209 -0.6713762132 -0.9622328809 -0.4156088030
[21] -0.1057604104 -0.1080067912 1.0760710189 -2.2282018191 0.1691822756
[26] 0.2119331993 -2.0032428528 0.1292716023 1.4784947389 -2.5275308229
[31] -0.7835384891 0.0481874173 -1.4669364872 1.1537231970 -1.9064883536
[36] -0.2459739423 0.8726698572 -0.4969926094 1.7752497452 0.2624641609
[41] -0.2309074089 -0.1516116112 -1.1909065323 0.0002574002 -1.5424558981
[46] -0.2960187897 -1.6423932082 -0.7875822410 0.9219703260 -0.8369667908
[51] -2.2088716251 0.8253377389 -0.8442818545 0.1563437055 -2.8817125284
[56] 1.1978028426 1.5668250370 0.6274130305 -1.4818866246 0.1270419269
[61] 0.2910166466 -0.0295232749 -1.7860117818 -0.5994955024 -0.3225441613
[66] -0.0733563571 0.6458471087 0.4863267973 -0.4962715097 1.7651987690
[71] -0.9342075774 -0.9347409249 -0.7135320522 -2.2911052459 0.2218280798
[76] 0.2580977620 -0.5894534196 0.5818916346 0.4231251079 1.0169511218
[81] 2.7704127651 -0.6164927112 0.5238315479 -0.5324345153 0.4030315456
[86] 1.0867954321 0.6053924792 -0.5237987183 0.0808417657 0.0562344034
[91] -0.2619032488 -0.2472796672 -0.1873331646 -1.7810937991 0.0551700542
[96] -0.8612402872 -0.9936895944 0.9046355703 -1.5022627792 0.6224666416
> 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.3162667366 -2.1656437325 0.1964899481 -0.1076285926 -1.3397633008
[6] -0.5244017800 -0.0514112308 -1.0567794909 0.3270004740 0.0880612317
[11] -0.3517164874 -1.2941488589 0.8793514269 -0.7541761185 0.1318489583
[16] -0.4455712162 1.5160098209 -0.6713762132 -0.9622328809 -0.4156088030
[21] -0.1057604104 -0.1080067912 1.0760710189 -2.2282018191 0.1691822756
[26] 0.2119331993 -2.0032428528 0.1292716023 1.4784947389 -2.5275308229
[31] -0.7835384891 0.0481874173 -1.4669364872 1.1537231970 -1.9064883536
[36] -0.2459739423 0.8726698572 -0.4969926094 1.7752497452 0.2624641609
[41] -0.2309074089 -0.1516116112 -1.1909065323 0.0002574002 -1.5424558981
[46] -0.2960187897 -1.6423932082 -0.7875822410 0.9219703260 -0.8369667908
[51] -2.2088716251 0.8253377389 -0.8442818545 0.1563437055 -2.8817125284
[56] 1.1978028426 1.5668250370 0.6274130305 -1.4818866246 0.1270419269
[61] 0.2910166466 -0.0295232749 -1.7860117818 -0.5994955024 -0.3225441613
[66] -0.0733563571 0.6458471087 0.4863267973 -0.4962715097 1.7651987690
[71] -0.9342075774 -0.9347409249 -0.7135320522 -2.2911052459 0.2218280798
[76] 0.2580977620 -0.5894534196 0.5818916346 0.4231251079 1.0169511218
[81] 2.7704127651 -0.6164927112 0.5238315479 -0.5324345153 0.4030315456
[86] 1.0867954321 0.6053924792 -0.5237987183 0.0808417657 0.0562344034
[91] -0.2619032488 -0.2472796672 -0.1873331646 -1.7810937991 0.0551700542
[96] -0.8612402872 -0.9936895944 0.9046355703 -1.5022627792 0.6224666416
> rowMin(tmp2)
[1] -0.3162667366 -2.1656437325 0.1964899481 -0.1076285926 -1.3397633008
[6] -0.5244017800 -0.0514112308 -1.0567794909 0.3270004740 0.0880612317
[11] -0.3517164874 -1.2941488589 0.8793514269 -0.7541761185 0.1318489583
[16] -0.4455712162 1.5160098209 -0.6713762132 -0.9622328809 -0.4156088030
[21] -0.1057604104 -0.1080067912 1.0760710189 -2.2282018191 0.1691822756
[26] 0.2119331993 -2.0032428528 0.1292716023 1.4784947389 -2.5275308229
[31] -0.7835384891 0.0481874173 -1.4669364872 1.1537231970 -1.9064883536
[36] -0.2459739423 0.8726698572 -0.4969926094 1.7752497452 0.2624641609
[41] -0.2309074089 -0.1516116112 -1.1909065323 0.0002574002 -1.5424558981
[46] -0.2960187897 -1.6423932082 -0.7875822410 0.9219703260 -0.8369667908
[51] -2.2088716251 0.8253377389 -0.8442818545 0.1563437055 -2.8817125284
[56] 1.1978028426 1.5668250370 0.6274130305 -1.4818866246 0.1270419269
[61] 0.2910166466 -0.0295232749 -1.7860117818 -0.5994955024 -0.3225441613
[66] -0.0733563571 0.6458471087 0.4863267973 -0.4962715097 1.7651987690
[71] -0.9342075774 -0.9347409249 -0.7135320522 -2.2911052459 0.2218280798
[76] 0.2580977620 -0.5894534196 0.5818916346 0.4231251079 1.0169511218
[81] 2.7704127651 -0.6164927112 0.5238315479 -0.5324345153 0.4030315456
[86] 1.0867954321 0.6053924792 -0.5237987183 0.0808417657 0.0562344034
[91] -0.2619032488 -0.2472796672 -0.1873331646 -1.7810937991 0.0551700542
[96] -0.8612402872 -0.9936895944 0.9046355703 -1.5022627792 0.6224666416
>
> colMeans(tmp2)
[1] -0.2416467
> colSums(tmp2)
[1] -24.16467
> colVars(tmp2)
[1] 1.077796
> colSd(tmp2)
[1] 1.03817
> colMax(tmp2)
[1] 2.770413
> colMin(tmp2)
[1] -2.881713
> colMedians(tmp2)
[1] -0.1694724
> colRanges(tmp2)
[,1]
[1,] -2.881713
[2,] 2.770413
>
> 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] -2.3682310 -4.6295427 0.1631522 -5.6301865 1.4217233 3.0220944
[7] 3.7678297 -0.9431506 -1.1019333 -3.5789724
> colApply(tmp,quantile)[,1]
[,1]
[1,] -1.2849534
[2,] -0.7919884
[3,] -0.5834928
[4,] 0.1613918
[5,] 1.5455487
>
> rowApply(tmp,sum)
[1] -0.5964854 -1.0625482 1.0292430 -2.0303215 -3.1627138 -2.2933677
[7] 4.4279726 -6.5647304 -3.4081554 3.7838899
> rowApply(tmp,rank)[1:10,]
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10]
[1,] 2 4 4 10 8 4 1 6 3 10
[2,] 5 2 7 1 1 3 9 9 2 7
[3,] 1 7 2 7 9 1 8 4 10 5
[4,] 4 1 10 9 3 5 2 2 4 1
[5,] 10 8 3 3 7 9 7 3 9 9
[6,] 8 9 8 5 5 2 3 10 7 3
[7,] 7 10 9 4 10 8 6 7 6 2
[8,] 9 5 6 6 2 7 5 8 5 6
[9,] 6 6 5 8 4 6 10 5 1 4
[10,] 3 3 1 2 6 10 4 1 8 8
>
> tmp <- createBufferedMatrix(5,20)
>
> tmp[1:5,1:20] <- rnorm(100)
> colApply(tmp,sum)
[1] 0.32674919 1.26970976 -0.04370500 -4.39453504 3.74333484 -0.19786808
[7] -0.13519410 2.16181136 0.02759927 -0.18784940 0.75525899 1.11492442
[13] -2.13313985 2.46410326 3.93431904 -1.20648632 -1.80775313 -0.84075530
[19] -2.12474960 0.28322641
> colApply(tmp,quantile)[,1]
[,1]
[1,] -2.21462956
[2,] -0.75571999
[3,] -0.03336928
[4,] 1.65646688
[5,] 1.67400114
>
> rowApply(tmp,sum)
[1] -1.19889331 1.01014364 0.03087424 1.52134352 1.64553262
> rowApply(tmp,rank)[1:5,]
[,1] [,2] [,3] [,4] [,5]
[1,] 13 19 6 1 20
[2,] 8 4 3 20 13
[3,] 5 12 12 3 17
[4,] 9 8 2 12 1
[5,] 12 14 20 11 19
>
>
> as.matrix(tmp)
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] -0.03336928 -0.3160261 -0.4396265 -0.23709000 -0.06426968 0.68177512
[2,] 1.67400114 -0.7598472 0.3257936 -0.34205534 0.63965956 -0.52154139
[3,] -0.75571999 -1.2329046 0.1324664 -1.36443296 1.57187744 0.03165087
[4,] -2.21462956 3.3490666 -1.3873540 0.02964082 -0.03213190 -0.45418300
[5,] 1.65646688 0.2294211 1.3250156 -2.48059755 1.62819942 0.06443032
[,7] [,8] [,9] [,10] [,11] [,12]
[1,] 2.2551688 -0.3364587 -0.159939123 -1.5173696 0.7835779 -0.4931222
[2,] -0.7724995 -0.1669876 0.804164561 0.7766229 -1.7352919 0.9126635
[3,] 1.4209372 -0.1327242 -1.458014234 -0.4010623 0.5379623 0.5568052
[4,] -1.4414934 2.0985978 0.831721139 0.3574351 1.3849448 0.4346867
[5,] -1.5973072 0.6993841 0.009666927 0.5965245 -0.2159341 -0.2961088
[,13] [,14] [,15] [,16] [,17] [,18]
[1,] -2.6390780 0.8341676 1.7380793762 0.11539108 -0.411330704 0.3440278
[2,] -2.3290215 0.4741005 0.9167285826 -0.12067420 -0.001120079 -0.4850760
[3,] 1.3466789 0.8823886 -0.0004834055 -0.99015216 -1.223122192 0.2463148
[4,] 0.5788278 0.7080512 -0.2630425210 -0.08664981 -0.198735671 -0.7893124
[5,] 0.9094529 -0.4346046 1.5430370122 -0.12440123 0.026555518 -0.1567094
[,19] [,20]
[1,] -1.1625860 -0.14081507
[2,] -0.4579443 2.17846840
[3,] 0.8070489 0.05535963
[4,] -0.4889850 -0.89511096
[5,] -0.8222832 -0.91467559
>
>
> is.BufferedMatrix(tmp)
[1] TRUE
>
> as.BufferedMatrix(as.matrix(tmp))
BufferedMatrix object
Matrix size: 5 20
Buffer size: 1 1
Directory: /Users/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: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 650 bytes.
Disk usage : 200 bytes.
> subBufferedMatrix(tmp,,5:8)
BufferedMatrix object
Matrix size: 5 4
Buffer size: 1 1
Directory: /Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests
Prefix: BM
Mode: Col mode
Read Only: FALSE
Memory usage : 561 bytes.
Disk usage : 160 bytes.
> subBufferedMatrix(tmp,1:3,)
BufferedMatrix object
Matrix size: 3 20
Buffer size: 1 1
Directory: /Users/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.6881225 -0.2564043 -1.050441 -1.186914 0.2520398 -0.5177347 0.5970141
col8 col9 col10 col11 col12 col13 col14
row1 0.06663734 0.2262826 -0.1573522 -0.3585168 -0.292671 0.8090542 0.04106576
col15 col16 col17 col18 col19 col20
row1 0.458958 -0.6993949 1.877051 0.6218834 -1.201679 0.5350452
> tmp[,"col10"]
col10
row1 -0.15735219
row2 -0.39448927
row3 -0.01916913
row4 1.17439008
row5 -0.15236231
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7
row1 0.6881225 -0.2564043 -1.0504409 -1.186914 0.2520398 -0.5177347 0.5970141
row5 0.2354303 0.4060861 -0.4127416 1.644160 1.9156518 -1.6754914 2.4129565
col8 col9 col10 col11 col12 col13
row1 0.06663734 0.2262826 -0.1573522 -0.3585168 -0.29267096 0.8090542
row5 -0.61013143 1.4367164 -0.1523623 -1.0838975 -0.04670741 1.3298276
col14 col15 col16 col17 col18 col19
row1 0.04106576 0.458958 -0.6993949 1.8770511 0.6218834 -1.2016788
row5 -1.92520920 -1.466579 0.3254800 -0.3140525 -0.8094341 -0.1218563
col20
row1 0.5350452
row5 -0.5858396
> tmp[,c("col6","col20")]
col6 col20
row1 -0.5177347 0.5350452044
row2 -0.6198738 0.7770714432
row3 0.1615676 -0.0005185929
row4 0.4126876 2.0612661194
row5 -1.6754914 -0.5858395585
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 -0.5177347 0.5350452
row5 -1.6754914 -0.5858396
>
>
>
>
> 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 49.11044 52.0576 50.25847 50.64512 50.65375 103.6278 49.12473 50.63401
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.61126 50.0462 52.82428 49.2173 49.20909 50.19836 49.3165 50.07111
col17 col18 col19 col20
row1 49.91678 49.83966 50.96824 105.5964
> tmp[,"col10"]
col10
row1 50.04620
row2 28.35214
row3 31.11595
row4 28.91132
row5 50.44905
> tmp[c("row1","row5"),]
col1 col2 col3 col4 col5 col6 col7 col8
row1 49.11044 52.05760 50.25847 50.64512 50.65375 103.6278 49.12473 50.63401
row5 46.73875 50.29336 50.92290 50.70673 52.12001 104.3795 48.97501 49.80976
col9 col10 col11 col12 col13 col14 col15 col16
row1 49.61126 50.04620 52.82428 49.21730 49.20909 50.19836 49.31650 50.07111
row5 50.58715 50.44905 47.86321 49.51339 50.35216 50.50960 49.43236 49.18914
col17 col18 col19 col20
row1 49.91678 49.83966 50.96824 105.5964
row5 51.81880 49.00586 49.72060 103.7334
> tmp[,c("col6","col20")]
col6 col20
row1 103.62784 105.59639
row2 74.65914 73.43573
row3 75.10833 75.54040
row4 75.53045 75.85203
row5 104.37954 103.73341
> tmp[c("row1","row5"),c("col6","col20")]
col6 col20
row1 103.6278 105.5964
row5 104.3795 103.7334
>
>
> subBufferedMatrix(tmp,c("row1","row5"),c("col6","col20"))[1:2,1:2]
col6 col20
row1 103.6278 105.5964
row5 104.3795 103.7334
>
>
>
>
>
> tmp <- createBufferedMatrix(5,20)
> tmp[1:5,1:20] <- rnorm(100)
> colnames(tmp) <- colnames(tmp,do.NULL=FALSE)
>
> tmp[,"col13"]
col13
[1,] -0.2467654913
[2,] -0.5623314787
[3,] -0.3800657288
[4,] 0.0005316486
[5,] 0.2662671451
> tmp[,c("col17","col7")]
col17 col7
[1,] -1.8659153 -0.7087468
[2,] -1.8390041 1.7553375
[3,] -0.4247522 0.2642745
[4,] -0.5601896 -0.5057151
[5,] -0.8468175 -1.0451975
>
> subBufferedMatrix(tmp,,c("col6","col20"))[,1:2]
col6 col20
[1,] 0.8806648 0.7738153
[2,] 0.5342521 0.9622312
[3,] -0.5903566 -0.1024052
[4,] 1.7037825 -0.9156783
[5,] 0.1952860 -1.6559258
> subBufferedMatrix(tmp,1,c("col6"))[,1]
col1
[1,] 0.8806648
> subBufferedMatrix(tmp,1:2,c("col6"))[,1]
col6
[1,] 0.8806648
[2,] 0.5342521
>
>
>
> 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.335347 -0.6206039 0.1537767 -0.4548979 -0.06708994 -0.2408404
row1 -0.772101 -1.0219475 -1.6050934 0.1575931 -1.52055069 0.1974405
[,7] [,8] [,9] [,10] [,11] [,12] [,13]
row3 0.86522833 1.4932959 1.6580805 0.6216732 -1.3155146 -1.044129 1.7102432
row1 0.01312402 0.7031832 0.5214301 -0.3682143 -0.0194031 -1.390930 0.9455334
[,14] [,15] [,16] [,17] [,18] [,19] [,20]
row3 1.3525929 2.6413190 -0.78508999 -1.462646 -0.7449336 1.3383908 -1.2019340
row1 -0.8865852 0.3322412 -0.08582475 1.164372 0.6120450 0.7118599 -0.1750555
> subBufferedMatrix(tmp,c("row2"),1:10)[,1:10]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row2 0.7802714 0.6431292 -0.2770832 0.7917493 -0.7615399 -1.43606 -0.6768132
[,8] [,9] [,10]
row2 -1.787465 -0.7508324 1.098735
> subBufferedMatrix(tmp,c("row5"),1:20)[,1:20]
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
row5 -0.6943646 0.9932654 1.339115 0.4229038 0.5874569 -0.1729871 -1.182148
[,8] [,9] [,10] [,11] [,12] [,13] [,14]
row5 1.501001 -2.487701 -1.031777 1.160634 -0.3496996 0.8660355 -0.7913135
[,15] [,16] [,17] [,18] [,19] [,20]
row5 -0.931079 0.3247043 -0.9995034 0.1026818 -0.4115103 1.123028
>
>
> 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: 0x600000e90360>
> is.ReadOnlyMode(tmp)
[1] TRUE
>
> filenames(tmp)
[1] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c934163b9f"
[2] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c91fa45e70"
[3] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c960341b4a"
[4] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c97cebc89d"
[5] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c95bbffb7d"
[6] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c91917fa9a"
[7] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c97545a154"
[8] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c92e62cdf2"
[9] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c958bee2a8"
[10] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c95c12b11c"
[11] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c94f29d47d"
[12] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c9433d8325"
[13] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c97b6d149f"
[14] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c936651207"
[15] "/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests/BM61c92582a577"
>
>
> ### 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: 0x600000e98900>
> MoveStorageDirectory(tmp,getwd(),full.path=TRUE)
<pointer: 0x600000e98900>
Warning message:
In dir.create(new.directory) :
'/Users/biocbuild/bbs-3.23-bioc/meat/BufferedMatrix.Rcheck/tests' already exists
>
>
> RowMode(tmp)
<pointer: 0x600000e98900>
> rowMedians(tmp)
[1] 0.0001326133 0.0787910268 0.1020673595 -0.3833095183 -0.3943153000
[6] 0.2591527273 0.2182247264 0.1333389995 -0.8510178003 -0.4456054315
[11] -0.3479840356 -0.2424487649 -0.2226580715 0.3116574188 -0.1928910921
[16] 0.2853495309 -0.1092579826 -0.6501984443 -0.2344851354 0.0359572955
[21] 0.4463290122 -0.0555090567 -0.4497359686 0.1124219648 0.1588497270
[26] 0.2685125895 0.1781626643 0.0061763085 -0.0539297292 0.0851644837
[31] 0.5787277289 -0.4101895952 -0.1009026286 -0.4308868334 -0.0028272245
[36] -0.2825537943 -0.1300932962 -0.5407245285 -0.1336628304 -0.1189713707
[41] -0.1894743510 -0.0523820778 0.0085016126 0.0372034910 -0.0563940394
[46] -0.4460046014 -0.0017229618 -0.3845766591 0.2868250055 -0.1482454297
[51] -0.3036284304 -0.0040612076 -0.3180966715 0.4061564222 0.1133511697
[56] 0.0642887697 -0.0466275580 -0.1641225924 0.4493286861 0.3590597742
[61] 0.4098978769 0.4022423806 -0.4459170212 -0.3633112028 -0.6335446905
[66] -0.0154506271 0.2396562417 -0.2277106677 -0.2434350899 -0.4681361070
[71] 0.5940282914 -0.3221110997 0.1251359218 0.3010937100 -0.1436488463
[76] 0.1840472450 0.1647631480 0.1829650544 0.2494147293 0.0337972348
[81] 0.5445629278 -0.1449287439 -0.1538346772 -0.5081963126 -0.1220014507
[86] -0.1980645074 -0.1723094601 -0.1613116446 -0.0462907017 0.0022101648
[91] -0.0061862557 -0.2199458932 0.7525811510 0.2254404738 0.0090061020
[96] -0.3925011033 0.0396457553 -0.1290458447 -0.1392525258 0.4907744485
[101] -0.6267687592 0.0900038513 -0.1682330059 -0.9004863647 -0.8628309384
[106] 0.0162676694 -0.2315407460 -0.2305857820 -0.0325091960 0.1026484250
[111] -0.0955268968 -0.0694098268 0.0135701665 0.7828432312 0.1748662913
[116] 0.0282304443 -0.3904084527 -0.0779799654 0.7670740323 0.1198233601
[121] 0.3375298090 0.3120286239 0.5338642068 0.5966896727 -0.1497699833
[126] -0.1556924629 -0.0622695939 -0.9306890761 -0.5635486556 0.2225752838
[131] 0.2734828627 0.1519680705 0.4530997633 -0.1107785680 0.1142543656
[136] 0.0455122871 -0.0659194553 -0.1259566480 0.2518933965 0.3868817481
[141] 0.0011816314 0.0081066911 -0.3848469370 0.2314568411 0.3053153304
[146] -0.1441769857 -0.2742872073 0.4450419260 -0.3203904640 0.1162848247
[151] 0.0610574778 -0.1893144903 -0.2859870509 -0.1894348315 -0.0391952848
[156] -0.0360984248 0.0384940551 0.6283101680 -0.1067231282 0.1123762233
[161] -0.3619414934 -0.0652800058 -0.2952941417 0.0746868468 -0.3439142290
[166] -0.2583457355 -0.4847010897 -0.1167686465 -0.2016131172 -0.2254487881
[171] 0.0119223926 0.5850342210 -0.5714726454 -0.4495327288 -0.1260338232
[176] -0.1357602319 0.4223626882 0.2217479199 0.0051696853 0.0829757542
[181] 0.0368656165 -0.1117626010 -0.4261989764 0.0141145428 -0.4519284859
[186] 0.5294475572 0.3569107567 0.2586776127 0.1047513194 -0.0319238255
[191] 0.3428283773 -0.4730892877 0.3130049764 0.1583609555 0.0901982128
[196] -0.0238657234 -0.3326144588 0.3536011688 0.1119521438 -0.2328380269
[201] 0.2804948400 0.7435197705 0.3795012248 -0.1728162973 -0.2402641658
[206] -0.5988883184 0.2008247335 -0.2800029656 -0.0625818806 0.4700082413
[211] -0.2918060092 0.2597751341 -0.0260019257 -0.5438037455 -0.5095348645
[216] 0.0944169073 0.0342514075 0.3295589408 -0.0452189750 -0.0192917652
[221] 0.5547131907 0.6594678870 0.3368213358 0.1151951395 0.1546558015
[226] -0.4645579968 -0.1259185093 0.2679729480 0.0950189137 -0.2819024299
>
> proc.time()
user system elapsed
0.642 3.520 5.186
BufferedMatrix.Rcheck/tests/rawCalltesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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: 0x6000022f0240>
> .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: 0x6000022f0240>
> .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: 0x6000022f0240>
> .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: 0x6000022f0240>
> 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: 0x6000022ec000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022ec000>
> .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: 0x6000022ec000>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022ec000>
> .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: 0x6000022ec000>
> 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: 0x6000022f8480>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022f8480>
> .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: 0x6000022f8480>
>
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000022f8480>
> .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: 0x6000022f8480>
>
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022f8480>
> .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: 0x6000022f8480>
>
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022f8480>
> .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: 0x6000022f8480>
> 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: 0x6000022f8660>
> .Call("R_bm_SetPrefix",P,"BufferedMatrixFile")
<pointer: 0x6000022f8660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022f8660>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022f8660>
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile68662f715532" "BufferedMatrixFile686639905df3"
> rm(P)
> dir(pattern="BufferedMatrixFile")
[1] "BufferedMatrixFile68662f715532" "BufferedMatrixFile686639905df3"
>
>
> P <- .Call("R_bm_Create",prefix,directory,1,1)
> .Call("R_bm_setRows",P,10)
[1] TRUE
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022f8900>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022f8900>
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022f8900>
> .Call("R_bm_isReadOnlyMode",P)
[1] TRUE
> .Call("R_bm_ReadOnlyModeToggle",P)
<pointer: 0x6000022f8900>
> .Call("R_bm_isReadOnlyMode",P)
[1] FALSE
> .Call("R_bm_isRowMode",P)
[1] FALSE
> .Call("R_bm_RowMode",P)
<pointer: 0x6000022f8900>
> .Call("R_bm_isRowMode",P)
[1] TRUE
> .Call("R_bm_ColMode",P)
<pointer: 0x6000022f8900>
> .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: 0x6000022ec180>
> .Call("R_bm_AddColumn",P)
<pointer: 0x6000022ec180>
>
> .Call("R_bm_getSize",P)
[1] 10 2
> .Call("R_bm_getBufferSize",P)
[1] 1 1
> .Call("R_bm_ResizeBuffer",P,5,5)
<pointer: 0x6000022ec180>
>
> .Call("R_bm_getBufferSize",P)
[1] 5 5
> .Call("R_bm_ResizeBuffer",P,-1,5)
<pointer: 0x6000022ec180>
> 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: 0x6000022f8ba0>
> .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: 0x6000022f8ba0>
> rm(P)
>
> proc.time()
user system elapsed
0.110 0.041 0.167
BufferedMatrix.Rcheck/tests/Rcodetesting.Rout
R Under development (unstable) (2026-02-28 r89501) -- "Unsuffered Consequences"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20
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.108 0.026 0.134